|
tracking refers to dragging the edge of the window.
i think it harks back to the days when windows displayed a 'tracking rectangle' as you dragged instead of the dynamic resizing we get today.
|
|
|
|
|
Thanks. Next question. I set my max size hardcoded as
lpMMI->ptMaxTrackSize = CPoint(1228,872);
because thats what looks best on my machine. My XP resolution is 1280 by 1024 . If I maximise this app on a lower resolution machine, its going to go offscreen right? Or will it get as big as it can and stop there? If it goes offscreen I dont know how we'll get a hold of it to minimize it again (if the title bar is offscreen).
Should I not code this line?
Thanks,
ns
|
|
|
|
|
The max track size will only allow the window to be tracked to the maximum size that you set, or as far as the cursor can resize the window. Basically the max size is the minimum of what you specify, and the size of the screen that the window is running on.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
many thanks! So I'm in no danger with my hardcoding....
|
|
|
|
|
have a look at the size that windows provides as a default.
typically this is the available desktop area.
then instead of hardcoding a value, you could do it like this:
lpMMI->ptMaxTrackSize.x = min(lpMMI->ptMaxTrackSize.x, 1228);
lpMMI->ptMaxTrackSize.y = min(lpMMI->ptMaxTrackSize.y, 872);
this way the size will not exceed your values on a high-res monitor but will also not exceed the desktop on lower-res monitors.
|
|
|
|
|
Appreciate your helpful responses. I actually tested the app hardcoded as is (without the nifty if condition you've given me, and it didnt make it off screen.). But I wil implement yopur solution.
Thanks again,
ns
|
|
|
|
|
Ok I know this is going to be simple, but how do I get a BN_CLICKED message for a static control?
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Only buttons send BN_CLICKED (BN = button notification). You need to set the "notify" property for the static, and then handle the notification the control sends, STN_CLICKED .
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
check it and try to run it
PeekMessage
who told u its simple?
r00d0034@yahoo.com
|
|
|
|
|
OK this is what I did. I open class wiz and overrid the OnCommand() function. I then check to see if hte wParam is equal to my static control. If it does then call what ever function I want. It worked out extremly simple. Just make sure you set the noify in the static control settings.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
You just need to make sure the control has a unique ID on the form and has the Notify style set for it in the resource editor.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
I have a file that include html,gif (I know the file format). Have any control to show the file? Or what shold do to view the file ?
|
|
|
|
|
any boduy tell how to use TRACE("")in non MFC application
?
or its equal code?
i am trying it in a MFC dll but it did not display any message to out put window all other code after that line executed but TRACE("message") does not execute.
although it has not any error compiler recognise it but did not execute it.
r00d0034@yahoo.com
|
|
|
|
|
char buf[1000];
snprintf(buf, 999, "my message #%d\n", number);
OutputDebugString(buf);
-c
"Half of the harm that is done in this world is due to people who want to feel important."
-- TS Elliot
|
|
|
|
|
if i want to creat my own service.
1-it can communicate on the network using socket programming while the system is logoff.
2-it can automaticall login after half an hour?
any body could provide the releted link.
i have done socket programming but i did not know how to creat such a service because when system is logoff all runing service are also destroy.
r00d0034@yahoo.com
|
|
|
|
|
if i want to know how many hwnd exist of a process how to know it ?
r00d0034@yahoo.com
|
|
|
|
|
I did a GetClientRect(&rect) in the OnInitialUpdate(), and got a set of values. In the OnSize event, I did the same and got a different value!! I did not resize!
OnSize() ran first, then OnInitialUpdate() when the app first started. I debugged and found that the values dont match! The OnSize rect is more accurate than the other, though (I believe)
ns
|
|
|
|
|
After I put the getClientRect of OnInitalupdate into an if, it worked predictably:
if(NULL != m_listdisplay.GetSafeHwnd())
{
GetClientRect
}
Any idea why? Outside the if rect is different from that inside the if
|
|
|
|
|
if i have process name then how to get its id ?
and its window hwnd ?
r00d0034@yahoo.com
|
|
|
|
|
Hi,
I'm trying to place a bitmap of the contents of my CHTMLView Derived class into the clipboard. But all I get when I paste the resulting bitmap is the VC++ IDE behind it.
Heres the code i'm using..
<code><font face="Courier New"><font color="#000000"> <font color="#000080">CRect rect</font><font color="#808080">;
</font> <font color="#000080">GetClientRect</font><font color="#808080">(</font><font color="#000080">rect</font><font color="#808080">);
</font> <font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">NormalizeRect</font><font color="#808080">();
</font> <font color="#0000FF">if</font><font color="#808080">(</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">IsRectEmpty</font><font color="#808080">() || </font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">IsRectNull</font><font color="#808080">())
</font> <font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font> <font color="#000080">CClientDC dcScrn</font><font color="#808080">(</font><font color="#0000FF">this</font><font color="#808080">);
</font> <font color="#000080">CDC memDc</font><font color="#808080">;
</font> <font color="#0000FF">if</font><font color="#808080">(!</font><font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">CreateCompatibleDC</font><font color="#808080">(&</font><font color="#000080">dcScrn</font><font color="#808080">))
</font> <font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font> <font color="#000080">CBitmap bitmap</font><font color="#808080">;
</font> <font color="#0000FF">if</font><font color="#808080">( !</font><font color="#000080">bitmap</font><font color="#808080">.</font><font color="#000080">CreateCompatibleBitmap</font><font color="#808080">(&</font><font color="#000080">dcScrn</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Width</font><font color="#808080">(),</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Height</font><font color="#808080">()))
</font> <font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font> <font color="#000080">CBitmap</font><font color="#808080">* </font><font color="#000080">pOldBitmap </font><font color="#808080">= </font><font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">SelectObject</font><font color="#808080">(&</font><font color="#000080">bitmap</font><font color="#808080">);
</font> <font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">BitBlt</font><font color="#808080">(</font><font color="#FF0000">0</font><font color="#808080">,</font><font color="#FF0000">0</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Width</font><font color="#808080">(),</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Height</font><font color="#808080">(),&</font><font color="#000080">dcScrn</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">left </font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">top </font><font color="#808080">,
</font> <font color="#000080">SRCCOPY </font><font color="#808080">);
</font> <font color="#0000FF">if</font><font color="#808080">(</font><font color="#000080">OpenClipboard</font><font color="#808080">())
</font> <font color="#808080">{
</font> <font color="#000080">EmptyClipboard</font><font color="#808080">();
</font> <font color="#000080">SetClipboardData</font><font color="#808080">(</font><font color="#000080">CF_BITMAP</font><font color="#808080">,</font><font color="#000080">bitmap</font><font color="#808080">.</font><font color="#000080">GetSafeHandle</font><font color="#808080">());
</font> <font color="#000080">CloseClipboard</font><font color="#808080">();
</font> <font color="#808080">}
</font> <font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">SelectObject</font><font color="#808080">(</font><font color="#000080">pOldBitmap</font><font color="#808080">);
</font> <font color="#0000FF">return </font><font color="#FF0000">1l</font><font color="#808080">;
</font></font>
</code>
I'm learning DC and painting functions as i'm going any help would be appreciated.
Thanks
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
try moving 'memDc.SelectObject(pOldBitmap)' before the clipboard calls.
i think selecting objects into a dc puts a lock on them until you deselect them; certainly, if you try to delete a bitmap selected into a dc it will not work, so this is worth a try.
|
|
|
|
|
Thanks,
It turned out to be declaring ClientDC instead of using GetDC()
but cheers for the help.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
how come this server code returns with this error.
C:\>tcpserver
We are awaiting a connection on port 5150.
accept failed with error 10014
here is the code where its failing...
<snippet>
// Accept a new connection when one arrives.
if ((NewConnection = accept(ListeningSocket, (SOCKADDR *) &ClientAddr,
&ClientAddrLen)) == INVALID_SOCKET)
{
printf("accept failed with error %d\n", WSAGetLastError());
closesocket(ListeningSocket);
WSACleanup();
return;
}
xai
|
|
|
|
|
This error code means "The system detected an invalid pointer address in attempting to use a pointer argument in a call.". Could post more code, particularly the declaration and initialization of the parameter you pass to accept() ?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
k i figured it out.... everything worked, except that i needed some kind of infinite loop so that it would constantly be looking for connections.
xai
|
|
|
|