|
From: Vlada D. <dj...@im...> - 2002-12-13 12:07:03
|
----- Original Message ----- From: "Zodiaq" <zo...@ac...> To: <Dev...@li...> Sent: Friday, December 13, 2002 12:18 PM Subject: Re: [Dev-C++] ID to handle > 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/win dowing/windows/windowreference/windowfunctions/createwindow.asp > > return value from CreateWindow is HWND (Handle to WiNDow)... > > To get handle to one item use GetDlgItem... > This will do. Thanks, Zodiaq. > 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 > > > > ------------------------------------------------------- > This sf.net email is sponsored by: > With Great Power, Comes Great Responsibility > Learn to use your power at OSDN's High Performance Computing Channel > http://hpc.devchannel.org/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |