Click to See Complete Forum and Search --> : SendMessage question, how do I use it?
koden
March 22nd, 2006, 01:50 PM
How do a do a SendMessage that resizes a window?
I have a progress bar and would like to send a message to it to resize. I only know how to make it step etc., but how do I resize? What's the message to send? what are the lparam and rparams?
also how do I insert new components into the dialog? What message do I send then? Do I need to create a custom message handler? And if so, how?
thanks
NoHero
March 22nd, 2006, 03:09 PM
AFAIK there is no message, which resizes the window, but you can use SetWindowPos (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp) to do that.:
void ResizeWindow(HWND hwndMyWindow, int iNewWidth, int iNewHeight)
{
SetWindowPos(hwndMyWindow, NULL, 0, 0, iNewWidth, iNewHeight, SWP_NOMOVE | SWP_NOZORDER);
}
koden
March 22nd, 2006, 03:27 PM
AFAIK there is no message, which resizes the window, but you can use SetWindowPos (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp) to do that.:
void ResizeWindow(HWND hwndMyWindow, int iNewWidth, int iNewHeight)
{
SetWindowPos(hwndMyWindow, NULL, 0, 0, iNewWidth, iNewHeight, SWP_NOMOVE | SWP_NOZORDER);
}
sweet! exactly what I've been searching for. thank you =)
NoHero
March 22nd, 2006, 03:36 PM
sweet! exactly what I've been searching for. thank you =)
You are welcome ;)
koden
March 22nd, 2006, 06:47 PM
sweet! exactly what I've been searching for. thank you =)
actually that's almost it... but I'm sending a message via an InstallShield program. It doesn't have that exact function.
Any ideas?
Mike Harnad
March 23rd, 2006, 08:36 AM
You might want to try sending WM_SIZE.
koden
March 23rd, 2006, 12:51 PM
that is just a message saying the window "was" resized. anyone else?
koden
March 23rd, 2006, 01:04 PM
is there a way to do a custom message that calls a function inside of the program you're sending a message to?
Mike Harnad
March 28th, 2006, 08:51 AM
that is just a message saying the window "was" resizedThat's correct. However, you can use it to resize the control if you pass the new size in LPARAM.
koden
March 28th, 2006, 01:08 PM
That's correct. However, you can use it to resize the control if you pass the new size in LPARAM.
awesome, I will try that out, thank you.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.