|
I think he got the problem of having CS_PARENTDC style.
- NS -
|
|
|
|
|
even if that style is present, if you take CClientDC or CWindowDC, it will apply the clilp so that the painting will not go outside that control.
Check the DCX_PARENTCLIP flag in the GetDCEx() function. CClientDC and CWindowDC calls this API with that flag.
|
|
|
|
|
The drawings should be in OnPaint. So the CPaintDC will be used. It is not having the clip.
Naveen.R wrote: Check the DCX_PARENTCLIP flag in the GetDCEx() function
It has NO use.
- NS -
|
|
|
|
|
NS17 wrote: The drawings should be in OnPaint
But he didn't mention so?
NS17 wrote: So the CPaintDC will be used. It is not having the clip.
And about the paint dc. I will all other parts that needn't to be updated in the current paint message. And offourse It will never allow you to draw on parent.
NS17 wrote: It has NO use.
Can u tell me why?
|
|
|
|
|
Naveen.R wrote: But he didn't mention so?
That I agree...
Naveen.R wrote: offourse It will never allow you to draw on parent.
Did you try it even once before?
Naveen.R wrote: Can u tell me why?
It is simply not working...
- NS -
|
|
|
|
|
the control is drived from CStatic.I use " CDC* pDC=GetDC();" to create the DC.
|
|
|
|
|
Simply the static control is having the CS_PARENTDC class style. That is reason of this issue. You can avoid the issue as I said before. Or you can remove this style from the class, which will solve the issue. But it is not promoted it because it will affect all the static controls.
- NS -
|
|
|
|
|
But How to remove such style?
|
|
|
|
|
Use SetClassLong( hWnd, GCL_STYLE, GetClassLong( hWnd, GCL_STYLE ) & ~CS_PARENTDC );
- NS -
|
|
|
|
|
Yes,it works well now.
Thank you very much.
|
|
|
|
|
Can you show your code how did you try to it?
|
|
|
|
|
Yes,I use CWindowDC,it works well,but CClientDC not.
Thank you all.
GOOD LUCK.
|
|
|
|
|
Hi All,
What is the difference between a parent and owner?
I have three functions
CWnd::GetParent ();
CWnd::GetOwner ();
CWnd::GetParentOwner ();
Please help.
Thanks,
NB++
|
|
|
|
|
In both cases, the parent or owner has been set as the parent of a control (e.g. SetParent(), or by specifying in the parent parameter of a Create() call).
The difference is that if the control was created with the WS_CHILD style, then the outer window is a PARENT. If it was created without this style, it is only an OWNER.
For a parent window, when the parent is minimized all child controls are hidden. For an owner only, 'owned' windows remain in place and can be minimized separately.
Note that only 'windows' can be owned - 'controls' *must* have a parent and are therefore created with WS_CHILD.
(GetParentOwner() will find the nearest window that is *either* a parent or an owner, but not a child - the others will keep walking up the chain until they find specifically one or the other.)
|
|
|
|
|
Hi,
I need to create an application that is shown in Windows Taskbar as a Toolbar, same as the Windows Media Player do.
I dont know where should I start.
Thanks in advance.
- NS -
|
|
|
|
|
search for Shell_NotifyIcon in msdn
i think this will help
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
They are called deskbands. check Here[^]
|
|
|
|
|
Thank you. I have to look...
- NS -
|
|
|
|
|
Hello, im pretty new to using win32 common controls, im wondering how to use the toolbar messages correctyl. Im writing an application that can remove icon's from the system-tray toolbar for annoying applications that dosn't allow you to remove their tray icon.
Here is my code, the button is hidden when i send a TB_HIDEBUTTON, but the toolbar is not resized properly at all, it shows cleary that a button is missing. So i need a way to automatically resize it to the correct size for the new number of buttons. I have tried TB_AUTOSIZE but it dosn't seem to have any effect.
Also, a second problem is the TB_GETBUTTONTEXT message, it returns a strLen of the button string correctly, but the "text" var is always just unilitialized garbage, i dont see why. Anyone knows why?
void main()<br />
{<br />
HWND hwnd = FindWindowEx(0,0,"Shell_TrayWnd",0);<br />
hwnd = FindWindowEx(hwnd , 0 ,"TrayNotifyWnd",0);<br />
hwnd = FindWindowEx(hwnd , 0 ,"SysPager",0);<br />
hwnd = FindWindowEx(hwnd , 0 ,0,"Notification Area");<br />
<br />
int index = 0;<br />
int count = (int)::SendMessage(hwnd, TB_BUTTONCOUNT, 0, 0);<br />
for(int i=0; i<count; i++)<br />
{ <br />
char text[1024];<br />
int strLen = ::SendMessage(hwnd, TB_GETBUTTONTEXT, i, (LPARAM)text); <br />
}<br />
<br />
BOOL b = ::SendMessage(hwnd, TB_HIDEBUTTON, 0, 1); <br />
b = ::SendMessage(hwnd, TB_AUTOSIZE, 0, 0); <br />
}
Thanks in advance
|
|
|
|
|
spaam wrote: Also, a second problem is the TB_GETBUTTONTEXT message
In your case the application you create and taskbar are two saparate process. So pointer you passed to TB_GETBUTTONTEXT is pointing is vaid for your application aonly. the other applcation cannot access this address. Thats why your getting junk values. What you need to do is allocate some memory in the target process using the VirtualAllocEx() function, then pass that pointer to the message. After the message, you can read the string using the ReadProcessMemory() function.
|
|
|
|
|
Hi all
Iam trying to develop a "Net Cafe" programme in vc++ 8. All communication between the Server and the Client are done through Socket.
My Problem was to Create the User Login Dialog ie: on that i want use disabling the Hot Key(Alt+Tab ,Ctl+combination) and enabling that after user logging.(Ctl+Alt+Del was done Disabled in Administrator )Rest of the hot keys only i wanted.
Give your Suggestion and if any sample code about this.
Awaiting for your suggestion.
-- modified at 3:02 Friday 7th September, 2007
shakumar
|
|
|
|
|
|
Hello Friends,
I am trying to change the Text of Start Button. But not getting sucess.
I am trying following code.
HWND hTray = ::FindWindow(L"Shell_TrayWnd", NULL);<br />
HWND hStart = ::FindWindowEx( hTray, NULL, L"Button", NULL);<br />
SendMessage(hStart, WM_SETTEXT, 0, (LPARAM)L"MyText");
But nothing seems to happen. But when I see in Spy++ it show the new text.
I dont know what is going on.
Even I dont know Can we change the Text or not.
|
|
|
|
|
I am using winxp and I can see the changes with your code. It's working fine.
So atleast one thing is confirmed, We can change the text
|
|
|
|
|
There is a possibility that the start button may be using a bitmap for drawing the face. So if you change the text it wont be updated. It depends on the windows theme that you use. Try changing the theme.
- NS -
|
|
|
|