|
hi world
I want to get all mouse messages towards my application...
I mean when the mouse move outside the window of my application, my application receive mouse messages nevertheless (and thus mouse coordinates too)!
I already use Set/Get/ReleaseCapture and SetWindowsHookEx but when the mouse is outside my application I couldn't receive mouse message...
My question: How to receive ALL mouse message towards my application? Even if the mouse moves outside the main window of my application...
Thanks in advace...
Hello World!!!
from Raphaël
|
|
|
|
|
As someone posted already, use SetWindowsHookEx in an injection DLL.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I already do that but it seems don't work... Moreover MSDN says: You should use global hooks only for debugging purposes; otherwise, you should avoid them. Global hooks hurt system performance and cause conflicts with other applications that implement the same type of global hook.
where can I find an example using a DLL?
Thanks for your help!
Hello World!!!
from Raphaël
|
|
|
|
|
|
thank you very much...
Next time I will seek first in CP!
Hello World!!!
from Raphaël
|
|
|
|
|
Hi,
I'm trying to disable and then re enable a firewire card (or any generic hardware device for that matter) through software. I'm doing this is so I can turn the power off and on to my firewire camera when it goes haywire without having to unplug it and plug it back in.
Im programming in visual c++ 6.0 on windows 2000 but any clues as to where to begin even if in other languages would be appreciated.
regards,
Tim
|
|
|
|
|
If you know the name of the driver, you can use the following API functions to start / stop / control
a service / driver.
OpenSCManager
OpenService
ControlService.
Look them up on MSDN for details on how to use them.
Alternatively, you may be able to find out the IOCTL codes to send a "reset" to your driver using
DeviceIOControl.
Iain.
|
|
|
|
|
Thanks Iain, exactly what I was looking for.
regards,
Tim
|
|
|
|
|
I newbie for VC++,I wanna exit my SDI app by coding. How can i tell to ID_APP_EXIT ?
Thank for your help.
|
|
|
|
|
PostMessage(WM_QUIT,0,0);
|
|
|
|
|
Either as per the previous message, or using ::PostQuitMessage(0)
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi..
you can use that
::PostMessage(theApp.m_pMainWnd->m_hWnd,WM_CLOSE,0,0)
|
|
|
|
|
Does anyone know how to draw over the top of other direct3d/opengl apps??
At the moment I have a modeless dialog window that has dx7 running in it (aka window mode) just drawing stuff. I have set it to topmost and I am also using this (below) every frame it draws, although it does seem to slow it down
SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
Is there any other way to do this??
And when I say draw over other apps I mean games like Half-Life Qauke 3 etc.
Thanks in advance.
|
|
|
|
|
hehe, opengl is very easy, especially for quake and half-life!
half-life calls glEnable every frame before drawing anything!
inject a dll by using for example ForceLibrary(http://mitglied.lycos.de/yoda2k/[^]), hook the GetProcAddress function and in that hooked function compare every entered lpProcName value with "glEnable" and hook this function!
when your hooked glEnable is called, call the original one, then draw your own objects!
DON'T FORGET TO PUSH THE MATRIX BEFORE DRAWING!!!
you can find source codes of wallhacks at http://www.unknowncheats.com[^]
another important thing: MOST OPENGL MANUPULATION ARE DETECTED AS CHEATS AND MAY CAUSE CDKEY BAN!
Don't try it, just do it!
|
|
|
|
|
Hi,
I am drawing a polygonal with Polygon() and using
SetBkMode(TRANSPARENT) but instead of getting the
original image with the lines of the polygon I am getting
a white image with the polygonal lines on top. When I use DrawText it does draw the text as an overlay on the image.
How do I do the same with drawing polygons?
Thanks,
|
|
|
|
|
If you're using MFC
dc.SelectStockObject(NULL_BRUSH); If not,
::SelectObject(hdc, ::GetStockObject(NULL_BRUSH)); Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Awesome.
Thanks very much Ryan.
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm trying to write a multithreaded application in C. I'm a little new to multithreading. I would like to know whether it is required to write a seperate function for each thread. I'm using CreateThread() to create a new thread called WaveInProc. Now if I want to create one more thread do I have to create anotehr function for it. I intend to create 4 such worker threads. A similar code on MSDN had used _beginthread. But it used the same function to handle all the threads. Can someone explain how a single function can handle different threads.
|
|
|
|
|
couldn't you just have the same thread function do different things based on the arguments you pass to it?
I always use a different function for each thread I run, but that's just because I want to keep them strait when I read through the code.
|
|
|
|
|
You can reuse the same function multiple times for multiple threads. Just be careful with variables - if you access global variables, make sure you use critical sections every time you change them.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
You should use _beginthreadex and not _beginthread neither CreateThread.
The difference is that the first one create a TIB structure type aka Thread Information Block.
This structure is important to correctly identify a thread and it's resources. After setting the TIB for the thread it ultimately calls CreateThread
Without this TIB, the c/c++ runtime engine couldn't guarante the properly cleanning of the associated thread resources.
Jeffrey Ricther in his book "Programming Windows Applications" explains it well. To check this assumptions do a search on google ... with both _beginthreadex , CreateThread and TIB ...
Joao Vaz
|
|
|
|
|
I have an edit box and use OnKillFocus to validate the user entry which can't be blank, which works fine. So if the user enters a blank entry into the edit box, a message displays telling them they can't enter blank entries.
The problem is that when the user presses the Cancel button, the edit box trys to validate the entry and displays the message box because there is not a valid entry in the edit box, and then gos around in a loop.
How can I get to keep my edit box validation but also exit if the Cancel button is clicked.
Thanks.
|
|
|
|
|
I wouldn't use OnKillFocus() , I'd do all the validation in DoDataExchange() . That way, everything is validated only when the user presses OK, or whenever you call UpdateData() . What if the user clicks in the edit box and then realises that they need to change something else in the dialog box first? They can't. Personally, I find this exceptionally annoying, and would probably stop using the program because of it. It's much more intuitive to only expect valid values when they are accepted by pressing OK.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Using OnKillFocus() in this fashion is a design flaw. Reconsider it. Do not enable the OK button UNTIL all controls contain valid data. For example, if you have an edit control (IDC_EDIT1) and it must be non-empty before the dialog can be dismissed, do something like:
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, m_edit1);
DDX_Control(pDX, IDOK, m_okbutton);
}
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
END_MESSAGE_MAP()
void CMyDlg::OnChangeEdit1( void )
{
m_okbutton.EnableWindow(m_edit1.GetWindowTextLength() > 0);
}
|
|
|
|