|
|
I want to change the caption of the dialog box itself. not its controls. SetWindowText is working only for the controls, not for the dialogbox
|
|
|
|
|
yes it does !!! because SetWindowText() is a member of CWnd which is also the base class of dialog boxes.
in any dialogbox event handler, put :
this->SetWindowText("My new dialog title");
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
thanx, it works fine now.
|
|
|
|
|
what made you say, it doesn't work??
VuNic
|
|
|
|
|
Hey
I was wondering how i should handle the WM_GETMINMAXINFO because i heard that it is the first message sent when creating a window and not the WM_NCCREATE message as i previously had thought.
Should i just place it in a if statement and handle it, something like this, or is there a way to handle it properly:
<br />
<br />
if(message - WM_GETMINMAXINFO)<br />
{<br />
return 0;<br />
}<br />
else if(message == WM_NCCREATE)<br />
{<br />
SetWindowLongPtr(hwnd, GWL_USERDATA, ((long)((LPCREATESTRUCT(lParam))->lpCreateParams)));<br />
}<br />
<br />
<br />
thanks alot
|
|
|
|
|
virtualrush wrote: I was wondering how i should handle the WM_GETMINMAXINFO
Why do you want to handle it in the first place?
What are you trying to achive that the default-implementation does not do?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I was told that if your class cant handle that first message it might crash your program, or am i confused because it will be handled automatically by the default window procedure.
thanks
|
|
|
|
|
Of my several MFC applications none does activly override the WM_GETMINMAXINFO message handler.
It is handled by the MFC-Framework just fine.
If you do barebones Win32 programming you *might* have to handle that message. I this case I apologise for leading you in the wrong direction.
Also, I can not rule out the possibility of crashing an application by sending it a forged WM_GETMINMAXINFO.
But I am not aware of such a possibility.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 8:10 Wednesday 25th January, 2006
|
|
|
|
|
As an occasional "real" C programmer (SDK level), I can say that I don't handle WM_GETMINMAXINFO - I leave it to the default handlers.
Don't the MFC gurus have a way to look at the MFC code, to see what MFC actually does with this message? As far as I remember (from talking to my local Alpha-geek) MFC just passes most of the low-level WM_ messages straight through to the native Windows handlers.
|
|
|
|
|
normanS wrote: Don't the MFC gurus have a way to look at the MFC code, to see what MFC actually does with this message?
CRect rectWindow, rectClient;
GetWindowRect(rectWindow);
GetClientRect(rectClient);
pMMI->ptMinTrackSize.x = rectWindow.Width() - rectClient.right;
pMMI->ptMinTrackSize.y = rectWindow.Height() - rectClient.bottom; is what I found as default behaviour. This is from CMiniFrameWnd and it might be different in other classes, but I did not find the implementation.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
virtualrush wrote: I was told...
Someone told you wrong, or you simply misunderstood.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
WM_GETMINMAXINFO is used if you want to specify the maximum and minimum
possible widths of the window.
|
|
|
|
|
Hi all,
I m making a screen capture utility.
My application takes the screenshot after certain intervals but
if a tooltip window appears on the screen during capturing process
it doesnt capture it.
Please tell me how can i inform my application that
a tooltip window appears on screen and how to
capture its window bitmap?
I m trying to do it as but got problem
<br />
EnumWindows(&TooltipsWndProc,1);<br />
<br />
BOOL CALLBACK TooltipsWndProc(HWND hwnd,LPARAM lParam)<br />
{<br />
CHAR buf[256];<br />
GetClassName(hwnd,buf,256);<br />
if((lstrcmp(buf,TEXT("tooltips_class32"))==0)<br />
|| (lstrcmpi(buf, TEXT("tooltips_class")) == 0))<br />
<br />
{ <br />
<br />
MessageBox(NULL, "Tooltip", "TT",1);<br />
}<br />
EnumChildWindows(hwnd,&KillTT_EnableTooltips,lParam);<br />
return TRUE;<br />
}<br />
Its doesnt work for only tooltips, on each button click
the above MessageBox appears.
Thanx for ur +ve reply.
|
|
|
|
|
I m still waiting for reply from any guru.....
|
|
|
|
|
So you want to be informed when a tooltip is created by any application? If this is the case you will probably have to install a system wide hook. Look up SetWindowsHookEx . I'd probably use the WH_CBT variety. If you're not familiar with system wide hooks (as opposed to the safer and easier thread local hooks) you should read up on it before coding one since system wide hooks inject code into other processes and can thus crash them or worse.
Steve
|
|
|
|
|
Hello!
I want to write some aplication for example some proprietary TCP client that will connect to some server and receive and send messages. I want this functionality to be encapsulated in DLL library. Some GUI client will load this DLL and call its functions. So far so good. But here is a problem...when TCP client receives some message, I want it to notify GUI client trough some kind of callback function. How do I do that? How do I call a function that is implemented in GUI part from TCP client DLL?
I know I did something like that long ago when I was learning about DLL from MSDN article. I can't find this article now. I checked local and internet version of MSDN, but I just can't find it. The title was something like "Introduction to DLL's" or something like that and contained nice pictures of text and data segments mappings. If somebody knows this article please direct me to it.
Best regards,
Rostfrei
|
|
|
|
|
define a register callback function that take a function pointer as a paramater and export it out of the dll.
EX
bool RegisterCallback(bool (*FP)(void *,const char *,const char *),void * passin)
This defines a function that takes a void pointer and a pointer function that returns a bool and takes a void pointer and two character pointers.
I have found that when you define a function that takes a call back you should allways have a void pointer in the callback deffinition and in the called function so you have some way to pass data into the callback.
a programmer traped in a thugs body
|
|
|
|
|
Hai,
I am just struggling to read the data which i have put into the LPSTREAM.
Can any one help me?
Here is the code snippet:
char *buf = new char[statstg.cbSize.LowPart];
hrRetTemp=lpStream->Read((void *)buf, statstg.cbSize.LowPart, &ulBytesRead);
I dont get any data in the "buf" .Pls help me.
Saravana Kumar
|
|
|
|
|
Run it in the debugger after placing a breakpoint after the Read call. When the breakpoint is hit type "hrRetTemp, hr" in the watch window. This should show a textual representation of the error.
Steve
|
|
|
|
|
hi
i have a dialog class.I want to get Document Pointer in that class and using that access a member variable of the Document class.
how to get the document pointer in the dialog class?
|
|
|
|
|
|
Instead of accessing the document's member variables directly, you'd be wise to use a "getter" method instead. For example, if the document contained information about a person, it should have method for retrieving that information something like:
class CMyDocument : public CDocument
{
private:
CString m_strName;
CString m_strAddress;
UINT m_uAge;
public:
CString GetName() const;
CString GetAddress() const;
UINT GetAge() const;
};
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
hi~everyone
i hava a question puzzle me ! when i used "CFile's" open()function read a file use unicode in windows 98
but it's allways fail !
please help me ande very thanks in advance!!
nothing
|
|
|
|
|