|
Hi,
How do I find out if a window (ie non-modal dialog) is currently visible. I've implemented a bool which can monitor it as SW_SHOW or SW_HIDE flags are used to show and hide it, but surely there's a 'native' way of finding this out.
Sorry if this is a real basic question but I can't find the answer in MSDN or the faq here. (I'm probably just not looking in the right place.)
Thanks,
Simon
|
|
|
|
|
How about BOOL IsWindowVisible(HWND hWnd) ?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Codes I found it in codeproject.
Win32 API style
HWND hwndT;
HWND hWndReturn;
hwndT=::GetWindow(m_hWndMDIClient, GW_CHILD);
while (hwndT != NULL)
{
TCHAR szWndTitle[256];
::GetWindowText(hwndT,szWndTitle,sizeof(szWndTitle)/sizeof(szWndTitle[0]));
if (strcmp (szWndTitle, "YOUR WINDOWS TITLE) == 0)
{
hWndReturn = hwndT;
WINDOWPLACEMENT wndpl;
::GetWindowPlacement((HWND) hwndT,&wndpl);
if(wndpl.showCmd == SW_SHOWMINIMIZED)
::ShowWindow((HWND) hwndT,SW_RESTORE);
::SendMessage(m_hWndMDIClient,WM_MDIACTIVATE,(WPARAM)hwndT,0); //Activates it
}//end if
hwndT=::GetWindow(hwndT,GW_HWNDNEXT);
}//end while
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I am resizing every control of a dialog, and I'm having problems with non-push like check boxes and combo-boxes. At issue is the "real check box" and the "scroll bar" (the downwards arrow) of combo-box. (The caption of the check box and the item display part of the combo box can be resized, at least partly.)
I'm using SetWindowPlacement for the resizing (it makes no difference if I'm using the Windows function or CWnd). This has no effect on the above components.
I tried it with SetWindowPos; the effect is remarkable.
1. the check box can be shrunk (and it works too!), but it can't be stretched.
2. the combo box can be shrunk in the width but not in the height, and when reducing the width, the "scroll bar" remains the same size (it will be even larger than the size of the control all together). The height can't be changed at all.
Does anyone have some experience with this and know of a solution?
Btw, all this is on XP)
|
|
|
|
|
Does anyone know of any source code/examples/libraries that allow you to burn to cd rom drives?
|
|
|
|
|
|
Do you know of any commercial libraries. I have searched but came up short.
|
|
|
|
|
There is the Nero CD Burning Api (can get it from their website ) and it is really easy. But your customers must have the nero burning rom installed on their computer.
Well... I am a beginner ...
|
|
|
|
|
Does anyone know how to get a screenshot of a window witch is hidden (WS_VISIBLE = 0).
I tried to send WM_PRINTCLIENT to that window, but it doesn't seem to work. I realy need that window to draw itself somehow into a device context I specify.
Please tell me if you know something about this.
Thanks
|
|
|
|
|
How about making it visible for only a few milliseconds and take a screenshot meanwhile?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes I know, I had that idea myself but my boss doesn't like it. There must be some other way. Thanks anyway.
|
|
|
|
|
Be aware that some windows simply can't be made visible. They have no paint routines and/or incomplete settings for the window creation itself. While not as common under Win32, it is still sometimes the easiest way to do some things.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Can anyone point me to an FTP server other than IIS that supports multiple host style directory listing(like UNIX,MSDOS,VMS etc etc). I have tried sambar and cerberus they only support UNIX style.
Thanks ,
amit.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
Have you looked at RhinoSoft's Serv-U[^]? It is easy to use and powerful.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
I only try to add a new message ,this is my first.
Let us rap off,for you,for me,for our man!
|
|
|
|
|
then we all hope that this will remain your first message!
Don't try it, just do it!
|
|
|
|
|
|
|
hi everyone,
i got the following problem: i'm writing a program taht exchanges xml-messages over a network and i use IXMLDOMDocumentPtr ' s to generate (and parse) the xml message.
my problem is that after memory allocated for the xml-docs remains allocated even after i load sth new into the IXMLDOMDocumentPtr so my prog keeps getting bigger and bigger.
here's how the thing works:
Parse(BSTR theXML)
{
IXMLDOMDocumentPtr theXMLDoc;
::CoInitialize(NULL);
theXMLDoc.CreateInstance(CLSID_DOMDocument);
theXMLDoc->loadXML(theXML);
//do something
theXMLDoc.Release();
}
so what did i miss?
i also tried taking the ::CoInitialize(NULL) out of there and put it into the constructor of the class, but then i always get errors while trying to .CreateInstance(..) because "CoInitialize has not been executed"
|
|
|
|
|
How about ::CoUninitailize(); after theXMLDoc.Release();?
|
|
|
|
|
tried that, but i the still get that 'CoInitialize has not been called' error (or a program crash).
probably i should mention that there are 2 threads running, so that function i described can be called by 2 threads at the same time. i also tried to use a mutex to prevent the function to be executed multiple times:
{
WaitForSingleObject(mutex,INFINITE);
::CoInitialize(NULL);
//...
::COUninitialize();
ReleaseMutex(mutex);
}
but still the same thing happens.
|
|
|
|
|
|
Hi,
How can I use editable List Control with Combo Boxes in CForm View Window.
(List Control will be used somewhere in middle of the window)
Thanks & Regards,
T R Raghavendra
|
|
|
|
|
i don't think that this is funny!
POST UR DAMN MESSAGE ONLY ONE TIME, NOT THREE TIMES!!!
Don't try it, just do it!
|
|
|
|
|
A typical method would be to handle the NK_DBLCLK message for the control. From there, get the mouse position (GetCursorPos), translate it to the control coordinates (ScreenToClient()) and do a hit test
From this you can identify the item index and the sub item (column) number. You can then get that items rectangle (GetItemRect). As you want to do an edit, depedning on what kind of edit you can:
Create a new control and place it at the items rectangle position/size, destroy the item when it loses the focus, and apply its changes. Or you could move an existing control on your form which was not visible/disabled to the right location and enable it. Then hide it when it loses the focus as before.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|