digitalmars.D.learn - using windows api functions
- lee (1/1) May 01 2007 I'm trying to call the OpenProcess() api function. I included std.c.wind...
- Stewart Gordon (7/11) May 01 2007 Using std.c.windows.windows.
- yidabu (18/19) May 02 2007 you can call any window api like this:
-
Stewart Gordon
(10/16)
May 02 2007
"yidabu"
wrote in message
I'm trying to call the OpenProcess() api function. I included std.c.windows.windows at the beginning of the file, but the compiler still does not recognize the function name. The function is defined in kernel32.dll . what am I doing wrong?
May 01 2007
"lee" <llee goucher.edu> wrote in message news:f17plf$26na$1 digitalmars.com...I'm trying to call the OpenProcess() api function. I included std.c.windows.windows at the beginning of the file, but the compiler still does not recognize the function name. The function is defined in kernel32.dll . what am I doing wrong?Using std.c.windows.windows. The translation there is hopelessly incomplete, or at least was last time I looked. A much more comprehensive translation is here: http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI Stewart.
May 01 2007
lee Wrote:I'm trying to call the OpenProcess() api function. I included std.c.windows.windows at the beginning of the file, but the compiler still does not recognize the function name. The function is defined in kernel32.dll . what am I doing wrong?you can call any window api like this: import std.c.windows.windows; //for WinExec import std.windows.charset; //for toMBSz void main() { // bbs.yidabu.com 注toMBSz函数是为了生成null结尾字符串 LPCSTR lpCmdLine = toMBSz(r"C:\Program Files\Internet Explorer\iexplore.exe http://bbs.yidabu.com/forum-10-1.html"); UINT uCmdShow = SW_SHOWMAXIMIZED; WinExec(lpCmdLine,uCmdShow); } // bbs.yidabu.com 下面就是定义要调用的windows api函数 extern (Windows) { export { UINT WinExec(LPCSTR lpCmdLine,UINT uCmdShow); } }
May 02 2007
"yidabu" <yidabu.nospam gmail.com> wrote in message news:f19qlq$27gh$1 digitalmars.com... <snip>you can call any window api like this: import std.c.windows.windows; //for WinExec import std.windows.charset; //for toMBSzWhere do you get that idea from? Firstly, only a tiny subset of Windows API functions are in std.c.windows.windows. Secondly, the functions in std.windows.charset aren't part of the Windows API at all.void main() { // bbs.yidabu.com 注toMBSz函数是为了生成null结尾字符串Oh dear. It would appear that the web interface is no good at letting you use non-ASCII characters. At the moment I can't figure out what character encoding that was _meant_ to be! Stewart.
May 02 2007