|
not sure, what do you exactly mean?
photo-shop works well for any monitor, E.g. when display "print size", pictures are exactly the same size on screen as printed (E.g. for CD cover, I can put a real CD on monitor to compare its size).
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I mean when you right click on the desktop and select properties, go to "Settings" tab, press "Advanced" and go to "Monitor" tab what does it say there. Does it mention your monitor by name or does it just say "Plug and Play Monitor". My thinking is that if Windows doesn't know what type of monitor you have it may be guessing (wrongly).
If Photoshop knows this would seem not to be the case however, unless it knows because it was told by the user when it was installed.
The call I gave you is the way you go about find the information in Windows so I'm not sure what else to suggest.
Steve
|
|
|
|
|
no one told photo-shop about screen size when installed, it detects itself.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Does this, or GetMonitorInfo() , help?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
the functon doesn't work for NT,95 and some of 98.
we can not use this kind functions (excluding many users).
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi all,
I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar.
So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using
pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);
I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps)
Thanks in advanced,
-----------------
Genaro
|
|
|
|
|
Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)?
I modified dialog in this way, it should work for other windows.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I tried that, but perhaps I just used modifyStyle incorrectly.
Can you please send me a code snippet of how you did it?
Thanks,
-----------------
Genaro
|
|
|
|
|
try
UNIT uRemove=WS_MAXIMIZEBOX|WS_MINIMIZEBOX;
//call
pYourWnd->ModifyStyle(uRemove,0);
//or call
pYourWnd->ModifyStyle(uRemove,0,SWP_NOSIZE|SWP_NOMOVE);
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I have a dialog box with some buttons, etc, and I wanted to make the dialog box full screen, and I was able to do that without any problems(using the code below). But I noticed that when it's full screen, that basically my dialog box has been shifted to the top left corner, with rest of the screen filled in gray to create the "full screen" effect. What I really want is my dialog to be in the center, with gray filled in around it to create the "full screen" effect. Is there any possible way to do this? Thank you!
This is where my controls show up in full screen
-----------
xxx
-----------
I would like to have my controls show up in the middle of the full screen
-----------
----xxxx---
-----------
Code I have to make it full screen:
int cx, cy;
HDC dc = ::GetDC(NULL);
cx = GetDeviceCaps(dc,HORZRES) +
GetSystemMetrics(SM_CXBORDER);
cy = GetDeviceCaps(dc,VERTRES) +
GetSystemMetrics(SM_CYBORDER);
::ReleaseDC(0,dc);
// Remove caption and border
SetWindowLong(m_hWnd, GWL_STYLE,
GetWindowLong(m_hWnd, GWL_STYLE) &
(~(WS_CAPTION | WS_BORDER)));
// Put window on top and expand it to fill screen
::SetWindowPos(m_hWnd, HWND_NOTOPMOST,
-(GetSystemMetrics(SM_CXBORDER)+1),
-(GetSystemMetrics(SM_CYBORDER)+1),
cx+1,cy+1, SWP_NOZORDER);
-- modified at 17:52 Thursday 26th January, 2006
|
|
|
|
|
You would have to move all the child controls. You could do it something like this:
struct OffsetInfo
{
OffsetInfo(HWND hWnd, int OffsetX, int OffsetY):
m_hDialog(hDialog), m_OffsetX(OffsetX), m_OffsetY(OffsetY)
{}
HWND m_hDialog;
int m_OffsetX;
int m_OffsetY;
};
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
OffsetInfo* pInfo = reinterpret_cast<OffsetInfo*>(lParam);
RECT rc;
GetWindowRect(hwnd, &rc);
POINT pt = {rc.left, rc.top};
ScreenToClient(pInfo->m_hDialog, &pt);
pt.x += pInfo->m_OffsetX;
pt.y += pInfo->m_OffsetY;
SetWindowPos(hwnd, NULL, pt.x, pt.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
return TRUE;
}
void CYourDialog::DoIt()
{
CRect rcBefore;
GetClientRect(&rcBefore);
CRect rcAfter;
GetClientRect(&rcAfter);
OffsetInfo oi(m_hWnd, (rcAfter.Width()-rcBefore.Width())/2, (rcAfter.Height()-rcBefore.Height())/2);
EnumChildWindows(m_hWnd, &EnumChildProc, reinterpret_cast<LPARAM>(&oi));
}
Note: I haven't tested this code but I believe that the concept is sound.
Steve
|
|
|
|
|
Steve,
Tried your solution, and works well!
Thank you very much!!
|
|
|
|
|
Hi all,
How can I manage the IP header of a TCP/IP Socket?
I know this is done using RAW sockets, I want some source code for TCP not UDP.
I have seen an example on the net but it did not work!
2nd Question: if I change my IP in the IP header and request some data via HTTP, would the data be sent to me or would it be sent to the new IP in the header??????????
Thank you all
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
|
I can answer your second question:
It will be sent to the IP that is set as source-IP in the outgoing header.
If your "real" IP was 10.127.3.54 and you change the header to read "Source-IP = 10.127.3.53", the answer to that packet will go to 10.127.3.53.
If there is an answer, that is. The target will simply drop most packets.
Oh, and if you are after messing the target up on purpose, you will (in most European, Asian and American countries) violate at least one law. Depending on where you are doing this from, you might get more than you expected in terms of response and jailtime.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Thank you man,
Really I am not in Euorpe nor in America... Regardless, I am here to learn some aspects of network programming
Thank you
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I am new to VC++ programming so I am sure this question will be very simple for a lot of you. I am trying to reposition a button every time the user resizes the dialog.
What is the best way to accomplish this?
Thanks!
|
|
|
|
|
masnu wrote:
What is the best way to accomplish this?
By reading the "Extras" section of this article.
"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
|
|
|
|
|
|
Use MoveWindow API.
Manish Rastogi
|
|
|
|
|
|
|
|
In MDI project. I want my child frame fill main frame window. So I inplement this in
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
CWnd* pwnd = AfxGetMainWnd();
CRect rect;
pwnd->GetClientRect( &rect );
cs.cx = rect.Width(); cs.cy = rect.Height();
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
It's very close to success. But look closely, you will find a bit off. main frame overlapped child frame a little bit. I think that is because of edge of main frame window. But I am getting client area, it should not include edge right? any one can explain?
|
|
|
|
|
I create a 1 column, 2 row splitter window. use CreateStatic, because I want too different view in each panes. But I also want dynamically delete a pane, how to do this?
Thank u.
|
|
|
|