|
The message WM_DISPLAYCHANGE ist sent to all windows on the screen (dont know about hidden ones, though!).
wParam ist the new color depth, lParam the new screen resolution.
Just have your dialog react to that.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
CRect dkRect;
(CWnd::GetDesktopWindow())->GetClientRect(dkRect);
and then use the left, up, right, bottom of dkRect to set the new size of your dialog
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
And you can use of WM_SIZE with MoveWindow or SetWindowPos.
|
|
|
|
|
If the resolution changes you get a message about it.
I wrote an article about positions of windows: http://www.codeproject.com/useritems/Multimonitor.asp
Greetings from Germany
|
|
|
|
|
I have an SDI application ,I want to disable toolbar and menuitems
for certain users. Toolbar buttons get hidden but menu items remain as it is. I checked cmu does not get null value.
this code is in MainFrame.cpp.
*- Instead of m_hWnd I tried ::AfxGetMainWnd() and
*- AfxGetApp()->GetMainWindow().GetMenu() but result is worse.
////////////////////////////////current code
CMenu* cmu = (CMenu*)::GetMenu(m_hWnd);
if(right[0] == 0)
{
ctb.SetState(ID_ADD_CUSTOMER,TBSTATE_HIDDEN);
UINT ui = cmu->EnableMenuItem(ID_ADD_CUSTOMER,MF_DISABLED);
}
if(right[1] == 0)
{
ctb.SetState(ID_INACTIVATE_ACCOUNT,TBSTATE_HIDDEN);
UINT ui = cmu->EnableMenuItem(ID_INACTIVATE_ACCOUNT,MF_GRAYED);
}
}
|| ART OF LIVING ||
|
|
|
|
|
What was the return value EnableMenuItem ?
|
|
|
|
|
I can get Graphics from CDC by using
Graphics g(pDC->GetSafeHDC()); // pDC is a pointer of CDC
for GDI+.
Is there any way to get reverse? That means I want to get CDC from Graphics.
Is it possible?
|
|
|
|
|
u can call CDC::FromHandle(graphics->GetHDC())
If u can Dream... U can do it
|
|
|
|
|
Thank u very much for your help.
It is working
|
|
|
|
|
when i doubleclick on the trayicon ... i want it to show the dialog i hav made..i used showdialog() but it did not work..u may say that dialog appear for few micro seconds only and i could not see it clearly...what should i do now??
|
|
|
|
|
thanks a lot for not providing me help... i solved it myself only...thanks...enjoy
|
|
|
|
|
dona jain wrote: thanks a lot for not providing me help
This is very rude.
Remember, nobody is here to provide 24x7 support. Follow community rules to be part of it.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi all,
How can one get the database (like Oracle, MySql and so on) that is used, when making use of an ODBC connection.
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi all,
I tried with the example given in the following link,
http://www.codeproject.com/system/AMFSServiceManager.asp
Also i tried with the function "QueryServiceLockStatus" for getting the status, but the database is locked, even i have admin rights i am unable to do a queury.
Help me in doing that. It is urgent.
thanks,
-- modified at 6:55 Friday 10th August, 2007
|
|
|
|
|
Hi,
I have got a for loop in that i am doing some calucation and adding some value to list box, (using AddString method of CListBox class), but i don't see values are not updated on dialog's listbox at the time of insertion, even i have place UpdateData(TRUE) before inserting a string and UpdateData(FALSE) after inserting a string,but at the end calucation i see all values placed in listbox. can any one suggest what am i doing wrong.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
|
Thanxs
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
Welcome
For your information:
While populating the items in the list, the GUI thread is blocked. That's why it is not updated by default. So if it takes much time for populating the list, the application will go to "not responding" state. In order to avoid that case you can use a worker thread to populate the list.
- NS -
|
|
|
|
|
There is no need to call UpdateData() when populating a listbox. You either need to update the listbox window after each insertion, or do this work in a separate thread so the main thread is not blocked. The former is obviously easier.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
How to find wheather a dilaog window is opened or not programatically.
Thanks
|
|
|
|
|
I'd try retrieving something from the window, such as DialogName.GetDC(), and then see if the function returns nothing, or something like that, although there should be a better way of checking.
|
|
|
|
|
You can use IsWindow, IsWindowVisible, etc
- NS -
|
|
|
|
|
Hi,
I have an option in my application tray menu to display a dialog.When i have used the IsWindowVisible also that particular dalog is displaying as many times the option in the tray menu is selected.If the dialog is already opened it should not open again.I have used the following code.But it doesn't work.How can i go further.
CDialog dlg;
if(dlg.IsWindowVisible())
{
dlg.ShowWindow(SW_HIDE);
}
Thanks
|
|
|
|
|
How do you show the dialog? DoModal?
Can you show me the code snippet of the menu option handling?
- NS -
|
|
|
|
|
void CMainFrame::OnSettings()
{
// TODO: Add your command handler code here
CSettings dlg;
if(!(dlg.IsWindowVisible()))
{
dlg.DoModal();
}
}
When i right click on my application's tray icon a tray menu will display.My tray menu have one of the option called "Settings".When click on "settings" the settings dialog( class name:CSettings) will display.But my problem is when i click on the settings n times,then n number Settings dilaog is opening.What i required is,if dilaog is already opened it should not open again.How can i do this.
Thanks.
|
|
|
|