|
From: Zodiaq <zo...@ac...> - 2002-12-13 11:19:02
|
Hello Vlada and all Dev-C++ users, Friday, December 13, 2002, 11:44:55 AM, Vlada wrote as follows: VD> Hi. VD> Here's the deal: I want to turn window ID number (#define ID_WND 100) to VD> handle to that window, so I can use it in SendMessage function. I tried to VD> use MAKEINTRESOURCE macro (HWND hwnd=(HWND)MAKEINTRESOURCE(ID_WND), but it VD> doesn't work as I expected. I read that return value of it is type LPTSTR. VD> Can that be cast as HWND? If not, is there some other way to do this? To create window from ID use CreateWindow (or CreateWindowEx) http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp return value from CreateWindow is HWND (Handle to WiNDow)... To get handle to one item use GetDlgItem... And last thing - if you are processing message from that window you get HWND as first param in its CALLBACK function... There is a way to get handle by using FindWindow, but I think that you can use one of previous... if you still don't know to do this give more info... VD> Regards, VD> Vlada -- regards, Zodiaq |