|
would intercepting WM_SETFOCUS be any different from calling SetActiveWindow(NULL) within the procedure of the button click?
I tried this:
<br />
LPDWORD pid, hpid;<br />
GetWindowThreadProcessId((HWND)wParam, pid);<br />
GetWindowThreadProcessId(hwnd, hpid);<br />
<br />
AttachThreadInput((DWORD)pid, (DWORD)hpid, TRUE);<br />
SetFocus((HWND)wParam);<br />
AttachThreadInput((DWORD)pid, (DWORD)hpid, FALSE);<br />
with no success (it does not move focus).
|
|
|
|
|
<br />
case WM_SETFOCUS:<br />
{<br />
LPDWORD pid, hpid;<br />
GetWindowThreadProcessId((HWND)wParam, pid);<br />
GetWindowThreadProcessId(hwnd, hpid);<br />
<br />
AttachThreadInput((DWORD)pid, (DWORD)hpid, TRUE);<br />
SetActiveWindow((HWND)wParam);<br />
SetFocus((HWND)wParam);<br />
SetForegroundWindow((HWND)wParam);<br />
AttachThreadInput((DWORD)pid, (DWORD)hpid, FALSE);<br />
printf("Focus changed %d", wParam);<br />
}<br />
break;<br />
seems to retain the focus on the app as long as i do not doubleclick on my panel.. button procedure is not caught though.
|
|
|
|
|
this does not work with Firefox. If i am editing in the location bar and press the volume button.. the whole url in the locationbar gets selected.. which means that i will overwrite whatever was previously written if i type something on my keyboard (unlike if i use the windows virtual keyboard).
|
|
|
|
|
Hi
I am using VC++ Dlls. I want to use ADO to get information from the Database. When i am trying to import the ado dll in my dll application it is giving errors like enum is redefined.
if i am declaring the same statement in Exe it is not showing any errors why? I am giving the import statement in this way.
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")
I have checked for the availability of that dll in the specified path.it is present.
Can anybody help me Its Urgent
Thanks in Advance
|
|
|
|
|
That is the correct statement if you have windows on c:. Where did you put this statement? The best place is near the bottom of stdafx.h.
John
|
|
|
|
|
Hello everybody!!
I'm having some difficulties using function GetModuleFileName. I don`t want to get the path for the current module. NULL is not serving my purpose.
Instead, I want to get the path of the filename from the edit box on dialog of my application. How to declare handle for this??
Thanx
|
|
|
|
|
kind_person wrote: Instead, I want to get the path of the filename from the edit box on dialog of my application.
Unless the filename in the edit control also has a pathname, you can't. Otherwise, you could use _splitpath() to separate the various components.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
I'm using Visual Studio 2003 and im finding it hard to subclass a control.
In Visual C++ 6, you had to class wizard to do that for you, and it was easy.
However the class wizard is different this time round, and when you click add class, it you cant select the base control from the class list.
I'm just wondering how you go about subclassing in Visual Studio 7.
Thanks Tom
|
|
|
|
|
C'mon man! Move ahead...Select MFC Class in the first dialog box and in the next dialog box....
whoa!!!
lemme me see u smile now!!!
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
|
Okay ive done my subclass, how do i bind it to the static box in my dialog?
Tom
|
|
|
|
|
Tom Moore wrote: Okay ive done my subclass, how do i bind it to the static box in my dialog?
Add Variable for particular Static Control. If you class doesn't appear add variable Wizard the Manully Modify DDX_Control Block for your variable
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: Tom Moore wrote:
Okay ive done my subclass, how do i bind it to the static box in my dialog?
Add Variable for particular Static Control. If you class doesn't appear add variable Wizard the Manully Modify DDX_Control Block for your variable
That was easy in Visual C++ 6, but im using Visual Studio 2003.
I goto the Add Variable and the class isnt in the combobox.
I then looked for the DDX_Control Box, but i dont think Visual C++ 7 includes that.
Any Ideas
|
|
|
|
|
I have a dialog box were i have few parameters to be
displayed at certain interval from a etherenet connection .
I am using the SetTimer(); ]
i set the time interval for about 2 minutes but the dialog
box doesnot respond to anyother events inbetween .There is
another command button but i am not able to click on it inbetween.
Is there any solution like as in VB ther is DoEvents for similar
situations.
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Maybe the app is collapsed by the commands executed in the timer. Try to execute them in a sepparate thread.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
vikas amin wrote: I am using the SetTimer(); ]
i set the time interval for about 2 minutes but the dialog
box doesnot respond to anyother events inbetween .
This is not normnal behavior. What is the code doing after calling SetTimer() ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
vikas amin wrote:
I am using the SetTimer(); ]
i set the time interval for about 2 minutes but the dialog
box doesnot respond to anyother events inbetween .
This is not normnal behavior. What is the code doing after calling SetTimer()?
on the timer event which fires the SetTimer()
it calls a function which sends a some reqest data to a embedded device
& gets the data from the device . this process can take maximum 10 seconds.
Later on this data is displayed on the DialogBox
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
The timer callback runs on the UI thread, which means that for the time the callback runs, the UI will not respond. Maybe that explains your problem.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
vikas amin wrote: on the timer event which fires the SetTimer()
it calls a function which sends a some reqest data to a embedded device
& gets the data from the device . this process can take maximum 10 seconds.
You should not be doing such time-intensive things in the timer-handling function. Fire off another thread to do that stuff so that the timer-handling function can get in and out in a fraction of a second.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hello everybody,
I'm having some difficulties using functions from the dbhelp library (I guess it's not very surprising when you see how it's documented...).
Here's what I need to do:
I want to be able to get symbols names and adresses in a running application from its pdb file.
And this is what I do:
I run toto.exe (E:\toto_Debug\toto.exe)
While the process is running, in my debuger I do:
Get process handle (hProcess)-> use it in SymInitialize(hProcess,NULL,false))
(returns ok)
The I try to load the pdb file: (me32 is the module corresponding to toto.exe, I'm not sure of this step)
SymLoadModule64(hProcess, NULL, "E:\\toto\\Debug\\toto.pdb", NULL, (DWORD64)me32.modBaseAddr, 1090560)
(returns ok)
and then I try to get a symbol from its name:
char szSymbolName[MAX_SYM_NAME];<br />
ULONG64 buffer[(sizeof(SYMBOL_INFO) +<br />
MAX_SYM_NAME*sizeof(TCHAR) +<br />
sizeof(ULONG64) - 1) /<br />
sizeof(ULONG64)];<br />
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;<br />
<br />
lstrcpy(szSymbolName, "main");<br />
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);<br />
pSymbol->MaxNameLen = MAX_SYM_NAME;<br />
<br />
SymFromName(hProcess, szSymbolName, pSymbol);
And the application crashes...(access violation).
Ok, questions now:
What is wrong in what I'm doing? I heard pdb files are handled is a strange way:
_does the dbgHelp library tries to find the pdb file itself in the same directory than the executable?
_Do you really have to call the SymLoadModule64 function or do you simply have to call SymInitialize with more appropriate parameters?
_If you really have to call SymLoadModule64, how do you get the module base adress?
I have to admit I'm really lost, if somebody could help me it would be greatly appreciated
Zillon
|
|
|
|
|
hello all,
how can i play all the animations including gif,swf,avi,mpeg and other video formats too in one vc++ application?.
Plz i need this.
Thank u in advance.
Regards,
Basheer.
|
|
|
|
|
U can use the Media Player ActiveX to play the MPEG.
For the AVI only u can refer the example in MSDN named "cmnctrl1"
For Gif there is a small example in CodeProject
There might be FlashPlayer ActiveX but i am not sure
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
hello Vikas,
Thank u very much for ur reply. yes for flash i got the activex (Shockwave player) and for Mpeg i used media player. but the problem is it should play the mpeg as a part of our application.
but in this case we are getting the controls like play, pause and others. i want them to use internally in my application.
could plz check this once. however thank u for ur reply.
Basheer.
|
|
|
|
|
use appropriate activex controls.
1.right click on the Dialog, then select "insert activex control"
(assume that u've selected Windows Media Player control)
2.Add a control variable to your control. (ie.IDC_MEDIAPLAYER1)
A dialog apprears asking wether to create a class for your activex control, clik yes.
3.now use that variable to access its methods,props etc,
m_Mplayer.play()
m_Mplayer.stop()
void CVideo::OnPlay()
{
m_MPlayer.SetFileName("c:\\basheer.wmv");
m_MPlayer.Play();
}
this'l play your video.
similarly for flash select shockwave flash Object.
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
hello Vivek,
Thank u very much for ur reply. yes for flash i got the activex (Shockwave player) and for Mpeg i used media player. but the problem is it should play the mpeg as a part of our application.
but in this case we are getting the controls like play, pause and others. i want them to use internally in my application.
could plz check this once. however thank u for ur reply.
Basheer.
|
|
|
|