|
Take a look at the SendInput Win32 API function. There also are commercial tools you can buy for automated testing that will do this too.
|
|
|
|
|
Hi,
in my dialog the users want to change focus not by using the tab-key, instead they want
to jump directly to the different controls using accelerators.
Therefor i want to check the key combination in the PreTranslateMessage method, to set the focus.
How can i check this, because i always get only one key in the pMsg->wParam variable
and not the combination.
Need some advise or another solution.
TIA, Chris
|
|
|
|
|
if (0 > GetKeyState(VK_MENU)) ALT Key down
if (0 > GetKeyState(VK_CONTROL)) CTRL Key down
and so on
Kurt
|
|
|
|
|
Chris, this is a built-in feature of dialogs and doesn't require any code on your part. Just create a static control and put it next to the edit box, e.g.:
P&rice: [edit box here]
The &r will show up on the screen as an underlined "r". Make sure the static is right before the edit box in the tab order, and then pressing Alt-R will move the focus to the edit box.
If you *really* have to support shortcut keys using Ctrl, not Alt, then you will have to do some code. But using Alt has been standard for years, so go with Alt.
|
|
|
|
|
How could one create a static bitmap control that is palette savvy? My controls look great at 16 and 24 bits but but in 8 bit mode they look disappointing.
Thanks
|
|
|
|
|
|
Sounds like fun to me. I've done plenty of bit blitting but I must profess an ignorance of DIB sections. How do they differ from Windows bitmaps?
|
|
|
|
|
DIBSections are similar to bitmaps in that you have a handle that you can work with (an HBITMAP in fact), but they are device independant. They offer the best of both worlds: device independance and ease of use. They are also extremely useful when working in CE, since CE doesn't support many of the DIB functions - but does support DIBSections.
|
|
|
|
|
Why whenever I create a modeless dialog, and show it using ShowWindow(SW_SHOW), do none of my dialog controls show up?
I have a very simple dialog with a static text label on it. I showwindow to show it. Sleep for a few seconds, and then showwindow to hide it. However, my static control never appears on the dialog.
Any ideas?
Thanks,
Frank
|
|
|
|
|
Hi,
Can someone give me a hint on how to Subclass the Back, Next and Finish buttons on a wizard propertysheet page ?, I want to add icons or bitmaps to these buttons to look better.
Thanks.
www.usro.net
|
|
|
|
|
You can use GetDlgItem on these buttons like any other control (IDOK, IDCANCEL, etc.). They can be subclassed in the WM_CREATE of the property sheet.
|
|
|
|
|
Thank you, I tried to subclass the buttons in the classical way, the application runs without problems, but the buttons does not get painted. I sublcassed with CButtonST found on this site.
www.usro.net
|
|
|
|
|
This may be a very easy one, but I am trying to return multiple files from a CFileDialog using the OFN_ALLOWMULTISELECT parameter. How do I return the filenames using GetStartPosition()and GetNextPathName()?
|
|
|
|
|
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.
|
|
|
|