FindWindowA failure
BlitzMax Forums/BlitzMax Programming/FindWindowA failure
| ||
Hi, this doesn't seem to work yet it worked totally fine in Blitz PLus.Extern "win32" Function FindWindowA%(NullString%,WindowText$) End Extern AppTitle = "test" Graphics 640,320,0 Cls Local handle = FindWindowA(0,"test") DrawText handle,0,0 Flip WaitKey what am I doing wrong, any ideas? thanks |
| ||
Extern "win32" Function FindWindowA:Int(NullString$z,WindowText$z) End Extern AppTitle = "test" Graphics 640,320,0 Cls Local handle = FindWindowA(Null,"test") DrawText handle,0,0 Flip WaitKey |
| ||
What is FindWindowA? There are a few posts with findwindow which you can search on and might give some help. |
| ||
papa: TOP MAN! it's that mysterious z after the $. I presume $z must mean shortstring or somthing, right? The actual param NullString wasn't a problem left as an integer as you can see by this now working code:Extern "win32" Function FindWindowA:Int(nullstring%,WindowText$z) End Extern AppTitle = "test" Graphics 640,320,0 Cls Local handle = FindWindowA(0,"test") DrawText handle,0,0 Flip WaitKey thanks again. |
| ||
Sweet, $z is a C String btw. |
| ||
Jake, If you are trying to get your own window handle there is a much simpler and elegant way. Remember that BMAX had to create the hWnd so it must be stored somewhere right? Local my_hWnd:Int = Primarydevice.hwnd |
| ||
OK thanks, that'll be quicker and not need a windows dll call. |
| ||
$z means zero delimited string. In other words, your strings have a 0 appended to the end which many C funtions require. |
| ||
yeah I know about those thanks, been using them since the year dot. Just needed to get Max to use the correct sort. |