|
OnDestroy[^] is called by the framework. Can you debug to check the issue with OnClose?
I am a HUMAN. I have that keyword in my name........
_AnsHUMAN_
|
|
|
|
|
I changed the code to childframe OnClose(),there im checking each window and gave this AfxMessageBox and it works fine.Thank for ur support.
void CChildFrame::OnClose()
{
if(iWindowNumber == 1)
{
if(AfxMessageBox("Do you want to close the Alarm?",MB_YESNO|MB_DEFBUTTON2,NULL) == IDNO)
return;
}
CMDIChildWnd::OnClose();
}
Anu
|
|
|
|
|
Hello , I'm programing in VC++ 6, and the entire project runs in a computer without keyboard but with touch screen.
The thing is that a have two app runnig at the same time, and I want the user to be able to switch between these apps by touching in a third app (called "Switcher",wich is always on top), this third app is a dialog based app, dialog's size is small and it has only two buttons, one for bring the first app to front and the other button to bring to the second app.
The project has to run over win 98 an over win XP.
How can i do to get wich app is The "Switcher" and bring the other to front but under the "switcher"?
|
|
|
|
|
Have you considered SetWindowPos() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You can use SetWindowPos to move, resize and change the z-index of a window, SetWindowPos[^]
So you could use this:
SetWindowPos(targetWindow, switcherHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
To bring the window to the front, by passing the handle to your switcher window as the second parameter the target application should appear just behind it. Rather than at the front of all windows.
|
|
|
|
|
Thanks, So I have to use this instruccion SetWindowPos(targetWindow, switcherHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); on my "Switcher" dialog, ok, my last doubt is how can I get the handler to the target window from the "Switcher" dialog?
|
|
|
|
|
If you know the title of the window, or its class name then you can use FindWindow[^].
If you don't have the name of the window, but do have a HINSTANCE then you can search through all of the windows until you find the one you need:
HWND tmpWnd;
bool foundWindow = false;
tepWnd = FindWindow(NULL, NULL)
while(tmpWnd != NULL)
{
HINSTANCE hInstance = ProcIDFromWnd(tmpWnd);
if(hInstance == windowInst)
{
foundWindow = true;
break;
}
else
{
tmpWnd = GetWindow(tmpWnd, GW_HWNDNEXT);
}
}
Without either a HINSTANCE the class name, or the window name then I don't think there's much you could do.
|
|
|
|
|
Ok, it's working for the app1 that I know his title, let say from the "Switcher" app it's possible bring the other app1(the one i know his title) behind the Switcher, but with the other app2 , (wich is no-modal dialog) it doesn't work , i do not know the name of his class and the dialog it has not title, so i went whith the code that you wrote, but compiler complains with ProcIDFromWnd, it says that is undeclared identifier, it seems that is not a valid intruction for VC++ 6 , ??
Anyway , since in the final projet will be runnig only these three apps, i thoth that the Switcher can bring the app 1(the one working) behind it and send it to bottom when the user wants to see the app2, mfc library says that it's possible to use the parameter HWND_BOTTOM instead hWndSwitcher in SetWindowPos(hWndTarget, hWndSwitcher, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); to do that, but it's doesn't work neither. What do you think?
|
|
|
|
|
I'm not sure why SetWindowPos wouldn't work, unless you have the wrong hWnd, but as for finding a window by its HINSTANCE this code should actually work. The sample I originally found was in VB so I guess that ProcIDFromWnd is specific to that, GetWindowThreadProcessId seems to be what we really need.
HWND tmpWnd;
bool foundWindow = false;
tepWnd = FindWindow(NULL, NULL)
DWORD procID = GetProcessId(hInstace);
while(tmpWnd != NULL)
{
DWORD id = 0;
GetWindowThreadProcessId(tmpWnd, &id);
if(id == procID)
{
foundWindow = true;
break;
}
else
{
tmpWnd = GetWindow(tmpWnd, GW_HWNDNEXT);
}
}
Bear in mind that this code would find all windows that a process owns, so if it has more than one then you'll have to try and figure out which one you really need.
|
|
|
|
|
Now i get these error messages from compiler:
error C2065: 'GetProcessID' : undeclared identifier
error C2065: 'hInstace' : undeclared identifier
I can't find a the equivalent instruction in VC++6 for GetProcessID
|
|
|
|
|
Well, the function does exist MSDN[^]
hInstace is just the handle for the process that started the window that you want to move, if you don't have that and want to find and move a window that has no title that you don't have a class name for, then your last option would be to look through all of the running processes and find the one you need, only then would you be able to look through all of the windows in search of the one the process opened.
|
|
|
|
|
Three parts:
-----------------
| | |
| | |
|---------------|
| |
-----------------
I only can split one frame to two parts, the top and the bottom. But when drag this form, the form is ghost image.
Is there example to split frame?
modified 2-Apr-12 13:12pm.
|
|
|
|
|
Lots of articles here on CodeProject showing how to use splitter windows. Try the Article Search in the menu above.
I must get a clever new signature for 2011.
|
|
|
|
|
Does anyone use CListCtrl's with multiple selection (i.e., without LVS_SINGLESEL)? If yes, could you post here or send me an email about why you do this, instead of (for example) using checkboxes to mark multiple items?
Thanks!
|
|
|
|
|
It is much easier to click CTRL+A or hold down the SHIFT key while using the arrow keys, than having to move up and down press the "space"-key to flip each item checkbox.
Many times one would combine selection together with checkboxes, where one can flip the checkboxes of all the selected items.
|
|
|
|
|
yeap many times, please pm me your email id, i would send it to you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
There's an email link in my post.
|
|
|
|
|
Hi All,
I want to Use the SQLFetchScroll to Move the Record to First Position.
There is no Article which gives clear clarity of this Usage.
Pls help me out.
Thanks & Regards,
Uday
|
|
|
|
|
There is a good description on MSDN[^]. I haven't tried, but I would guess you use FetchOrientation = SQL_FETCH_FIRST, and FetchOffset = 0 to get the first record.
|
|
|
|
|
Hi,
Im having MDI application.In that for only one view, iam adding menu.
So i reffered one article form MSDN and i create the menu for that particular view.
http://support.microsoft.com/kb/118435[^]
By using this document i coded and i got my menu also.
But what i need is?
Actually for that particular child window im setting size of the window as 0,0,1500,700.
When i set this,the child window menu is attached with mainframe,only the window is getting this postion.
How can i change this.
I want to move this menu from mainframe to the childwindow(below the caption bar).
Pls help.
Anu
|
|
|
|
|
In google chrome they have checksum value for bookmark file.if i add any bookmark manually i need to change checksum value otherwise browser don't display bookmarks...
|
|
|
|
|
Well, Chrome is open source. Presumably the algorithm is in the code somewhere.
Check out http://dev.chromium.org/developers/how-tos/get-the-code[^].
There is a link to search the code on that page, but I couldn't find it, but is is there somewhere. Also Chrome calls bookmarks favourites.
|
|
|
|
|
When I try to save a text file with non-English text in Notepad, I get an option to choose between Unicode, Unicode Big Endian and UTF-8. What is the difference between these formats?
which of these formats is better?
(Assume that the text can be in languages like Chinese or Japanese, in addition to other languages.)
please tell me which option is better and why?
thanks in advance.
|
|
|
|
|
|
What i know is Unicode is UTF-16 and it is of two types big-endian and little-endian.
The difference between the Unicode and UTF-8 is explained in link below:
->[^]
You can save the file in all format but it is better if you are choosing UTF-8.
I think you already know the DOM character. You have to write this DOM character at first and than your data, so that your file is automatically saved in UTF-8 or Unicode format.
Bytes Encoding Form
00 00 FE FF UTF-32, big-endian
FF FE 00 00 UTF-32, little-endian
FE FF UTF-16, big-endian
FF FE UTF-16, little-endian
EF BB BF UTF-8
I use the UTF-8 format because Java client use my text file and it only support UTF-8 not unicode.
[EDIT] One more thing if you have any doubt about Unicode than always prefer unicode.org [/EDIT]
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|