|
If pressing CTRL+ALT+DEL in Win9x a box appears, which displays all runing applications. You can select an application an click on 'Close Task'. Everybody knows that.
The Problem:
If I select, for example Windows Explorer, and click on 'close task' the Windows Explorer will be closed at once. If I select my application and click on 'close task' a dialog appears after 30 seconds or so, which tells me 'task is not responding, blah, blah 'end task' 'wait' '. (My application is not crashed!)
The Question:
Can anybody tell me what messages are send to an application from the 'close task'-box or which messages do I have to handle? Or is there another solution for this problem?
thanks for your help!
|
|
|
|
|
I would send WM_QUIT message to the main window of a running application if I wanted to close it. WM_CLOSE message might be a good choice as well. These are two messages that could be used to kill an application nicely. If application is still running then it is highly probable that some overkill solution like TerminateProcess() function is used.
Regards,
Andrei Zenkovitch
Dundas Software
|
|
|
|
|
Hi,
i have several modeless dialogs and i want know when the dialog gets the focus.
I haven't found any message which is send to the dialog before he gets the focus.
Any solution?
TIA, Chris
|
|
|
|
|
Chris,
Try to handle WM_ACTIVATE message. Dialog itself doesn't get focus. Instead when dialog window is deactivated it remembers the child window that had focus last and when it is activated the dialog will set focus to that child window.
Regards,
Andrei Zenkovitch
Dundas Software
|
|
|
|
|
hi,
I have three property pages on a property sheet.
I have set the 'tab stop' property for all the
editboxes,radiobuttons and other controls on the
property pages.
From the resource editor when i do a test run its
fine. but when i run my application and display
the dialog the tab does not work.
whenever i press tab it beeps.
any idea what i am doing wrong?
Gita
|
|
|
|
|
hello,
I have implemented a component from scratch. i mean including the classfactory. (no ATL)
I create an instance of the object and when i try to
register it with the running object table it queries
for two interfaces IMarshal and IProxyManager( i
determined this using the IID's). why are these
being invoked?
Also initially i had derived my interface from IUnknown
and the call to register failed(crashed).
when i derived it from IDispatch and implemented the IDispatch methods i found that the GetTypeInfoCount,GetTypeInfo and the GetIdsfromNames methods are being called.
Why are these being called? The parameter values for these methods are also some huge values like 55648930
Could someone explain this to me.
Thanks in advance
Gita
|
|
|
|
|
Hi Gita,
My first question is why do you use the ROT for component registering? Usually you do this only if you are writing your own moniker class.
I can't say anything about the IProxyManager interface, but if the IMarshal interface was queried it means that somebody wants to create a proxy for your object.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hello Alex,
I am not writing my own moniker class but i am using
monikers.
I need to access my component from another process. I
use the component to exchange data between an ActiveX
component and an application.
So i register it with ROT using an ItemMoniker created with the ClassId. And then i get an itf pointer to the same object from my application.
Initially i tried by registering the OCX itself with ROT and it worked fine. I could even invoke the methods.
But the problem was revoking it from the ROT. I aint in a position to decide when the use of OCX is over. So i decided to have another component between the ocx and appln.
I am new to this. So its trial and error. I found use of Monikers and ROT the simplest. Is there a better way to do it?
I have one more question. I finally managed to register the object with the ROT (i tried with the ROT method Register and well as RegisterActiveObject) but when i try to get
an itf pointer to it , in my application, it simply deletes the entry from ROT!!
I am unable to pinpoint where i am going wrong.
Any suggestions?
-Gita
|
|
|
|
|
Hi,
If you want to keep the object in the ROT till it's registration is explicitly revoked you can use the "strong" registartion by specifying ROTFLAGS_REGISTRATIONKEEPSALIVE flag in the IRunningObjectTable::Register method.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi Alex,
The trouble is that it gets deleted despite me using the
ROTFLAGS_REGISTRATIONKEEPSALIVE flag!
-Gita
|
|
|
|
|
Hi!
??? Concerning MSDN it MUST stay there till you call Revoke method.... ??? I have no idea what's going on...
Alex Gorev,
Dundas Software.
|
|
|
|
|
I want to play two movies at the same time side-by-side, one using MCIWnd and the other one using CMediaPlayer (Windows Media Player ActiveX Control).
The following code does it, except that I have a background image that should appear on top of the two controls.
My question: why the bitmap doesn't appear on top of the CMediaPlayer control (while the bmp appears on top of the MCIWnd control!) ?
I thought ::SetWindowPos( ... , HWND_BOTTOM, ...) will place the control at the bottom of all other control?
void CMyDlg::OnButton1() {
HWND hMCI;
hMCI = MCIWndCreate(m_hWnd,AfxGetApp()->m_hInstance, MCIWNDF_SHOWNAME|MCIWNDF_NOMENU, "C:\\1.avi");
::SetWindowPos(hMCI, HWND_BOTTOM, 10,10,200,200, SWP_SHOWWINDOW);
MCIWndPlay(hMCI);
// CMediaPlayer2 is a class from Windows Media
// Player ActiveX control
CMediaPlayer2 m_media;
m_media.Create( "Media", WS_VISIBLE, CRect(250, 10, 550, 260), this, 1234);
::SetWindowPos(m_media.m_hWnd, HWND_BOTTOM, 250, 10, 200, 200, SWP_SHOWWINDOW);
m_media.SetFileName("C:\\2.avi");
m_media.Play();}
If anyone can explain this to me, I really appreciate it. Thanks for any help in advance.
|
|
|
|
|
Is there any way to use some of the simple MFC
data types and collections like CString,
CTime, CUIntArray, etc. inside ATL methods?
The compiler keeps barking at me when I
include afx.h:
#error WINDOWS.H already included. MFC apps must not #include <windows.h>
I've tried few things without luck.
I'm pretty much resigned to writing a class
to isolate ATL from the MFC stuff.
I have some old code that uses these things pretty
heavily and I would like to incorporate this code
without a major rewrite.
|
|
|
|
|
If you have an ATL dll project you only need to check "Support MFC" in the first page of the wizard. If you are building a ATL exe project a little more work is involved. This info can be found in KB article Q173974 located at:
http://support.microsoft.com/support/kb/articles/Q173/9/74.ASP?LN=EN-US&SD=msdn&FR=0
You should also consider linking to MFC statically if you are only using simple data types.
|
|
|
|
|
Hi,
I think the best thing to do is to use Windows Template Library instead of MFC classes. WTL is a set of classes that extend ATL to support more complex user interfaces for either applications or various UI components, while maintaining the big advantage of ATL - small and fast code.
It doesn't have all the data types you need but it has CString, CRect, CPoint, CSize and lot's of other useful things. So if the size of the code and performance are important to you - go with WTL.
WTL is a part of Platform SDK and you can download it from http://www.microsoft.com/msdownload/platformsdk/setuplauncher.htm.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi!
You have to send (submit) the data to the server using the HTTP POST and format it according to RFC 1867. This document describes the file uploading data format. It's not complicated and I don't think you will have any problems implementing it.
You can find this RFC at http://www.rfc-editor.org/rfc/rfc1867.txt.
Regards,
Alex Gorev,
Dundas Software
--- Original Message ---
> Who Can tell me How to use Visual C++ Writing a
> Appliccation Program that can simulate IE Runing home
> page as follows
>
>
>
>
> .
> .
> .
>
|
|
|
|
|
Thanks you for your Suggest!
But I think I need a sample code that Visual c++,
Because it is more helpful for me!
|
|
|
|
|
Unfortunately I don't have any source code examples and I have no idea where you can get them.
Alex.
|
|
|
|
|
Who Can tell me How to use Visual C++ Writing a Appliccation Program that can simulate IE Runing home page as follows
.
.
.
|
|
|
|
|
Hi,
How do I display the same Property Sheet that is shown when we select 'Properties' from the context menu on a file or directory in Windows Explorer. I want to display the properties of a file when I select 'Properties' from the context menu on Background , but do not want to create a dialog template of my own and populate the dialog with all the information. I want to reuse the resource that Explorer uses and I use IShellExtInit,IContextMenu and IShellPropSheetExt in the same time.
Thanks in advance,
Maria
|
|
|
|
|
Have you tried using ShellExecute with the "properties" and the file you want information about?
Example:
ShellExecute(hMyWindowNotExplorer, "properties", "c:\\winnt", "", "", SW_NORMAL);
Hope this helps.
-Erik
|
|
|
|
|
Hi.
I had tried using LBS_OWNERDRAWFIXED function when I create a new window for LISTBOX. I can received the WM_DRAWITEM message and changed the text with background color then send text to display (I used 'TextOut' function.) as far, the work is find , there will be able display which one message with color I want to display on listbox window, but when next message "WM_PAINT" will clear all, let the window blank. can you tell me what's wrong I got??
If possible that I can got the Listbox item HDC directly without using LBS_OWNERDRAWFIXED?? If can then how about the EditBox HDC??
Thanks for you helps.
Jason.
|
|
|
|
|
The WM_CTLCOLORLISTBOX message is sent to the parent window of a list box before the system draws the list box. WM_CTCOLOREDIT too. By responding to this message, the parent window can set the text and background colors of the list box by using the given display device context handle.
WM_CTLCOLORLISTBOX
hdcLB = (HDC) wParam;// handle to list box display context
hwndLB = (HWND) lParam; // handle to list box
This is for 32 bit only for 16 you have just WM_CTLCOLOR and then need to switch on the WPARAM
|
|
|
|
|
Hi,
I still unable to figure out the process of registration of my components via Browser. Can you give me the more details how can do this?? May be little bit example.
|
|
|
|
|
Hi!
You have to package your component and the best way to do this is to use the CAB files. In the .INF file of the package you will be able to specify which controls the browser should register. All this information is IE related I'm not sure how it will work in Netscape Navigator.
See more details in the MSDN article "Packaging ActiveX Controls".
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|