|
Ehehe
I've already done the same query on google, but all I've found are precompiled drivers like this one. But I need to do a lot of customization on this project. I described only the base of the project, but there's going to be a lot of other little stuff going on, so I cannot use a 3rd party driver.
|
|
|
|
|
|
hello, i have a callback MouseProc function that's not being called, what's wrong? thanks
LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lparam){
ofstream output1("debug.txt",ios::out);
output1.write("hello",strlen("hello"));
output1.close();
return -1;
}
HOOKPROC hookproc = (HOOKPROC)GetProcAddress(hInstance, "MouseProc");
SetWindowsHookEx(WH_MOUSE, hookproc,hInstance,GetCurrentThreadId());
the following is the main function in detail:
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int Cmd) {
MSG msg;
// Setup and register the window class;
WNDCLASS wClass;
wClass.style =CS_HREDRAW|CS_VREDRAW;
wClass.lpfnWndProc =WindowProcedure; // callback-function;
wClass.cbClsExtra =0;
wClass.cbWndExtra =0;
wClass.hInstance =hInstance;
wClass.hIcon =LoadIcon(hInstance,IDI_APPLICATION);
wClass.hCursor =LoadCursor(NULL,IDC_ARROW);
wClass.hbrBackground =(HBRUSH)(COLOR_WINDOW+3);
wClass.lpszMenuName =NULL;
wClass.lpszClassName =WINDOWNAME;
RegisterClass(&wClass);
// Create the window and store the handle;
hWnd = CreateWindow(WINDOWNAME, // class name;
WINDOWNAME, // window name;
WS_OVERLAPPEDWINDOW, // window style;
CW_USEDEFAULT, CW_USEDEFAULT, // starting position (x,y);
320, 240, // width and height;
NULL, // parent handle;
NULL, // menu handle;
hInstance, // instance handle;
NULL); // other parameters;
// Check if window creation failed; otherwise show and update;
if(hWnd==NULL) return FALSE;
else {
ShowWindow (hWnd, Cmd);
UpdateWindow(hWnd);
//HWND prevWind=SetCapture(hWnd);
//cerr<<"previous window is "<
|
|
|
|
|
Is hookproc valid ?
~RaGE();
|
|
|
|
|
i believe it is, but maybe not.... that's why I'm asking the question..
|
|
|
|
|
I'm using a DIB and StretchDIBits to print a bitmap to various printers. My problem is that, when I'm printing to a printer that supports only black & white only the very dark colours are visible in the printout. I'm not sure how to, first of all check for printer colour settings and secondly how to then set up the Pallette to support black & white settings. Is there anyone who can offer any advice. Even pointing me in the right direction will be much appreciated.
|
|
|
|
|
I'm trying to use ifstream under vc++ 6.0, it was not found.
I did #include<iostream> or #<iostream.h> and i looked at the iostream.h, nowhere was ifstream to be found. what's going on????
thanx
|
|
|
|
|
nevermind it's in fstream.h, my bad, I'm new to c++
|
|
|
|
|
Well, with such a nickname, we had expected a little bit more from you
~RaGE();
|
|
|
|
|
hehe the king of the world doesn't know c++, I doubt any king knew c++ :P
|
|
|
|
|
king_of_the_world ...
Hmm, that would be upper management. They usually don't know anything useful.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
Hmm, that would be upper management. They usually don't know anything useful.
I don't understand. You said "usually", have you found an exception to the rule? If so, rest assured that such an anomaly will not last for long!
|
|
|
|
|
i Creat an Object of CWnd (i name it cw) and Draw it in the main Window (this) and then i draw a bitmap in the cw.
my problem is when i draw a line in the main window that line affect cw and it's contents.
and then i have to cw->RedrawWindow(); to get the Real appearence back.
is there any way to Lock an Object of CWnd or do something to Stop this.
|
|
|
|
|
Try setting the style "Clip children" in the resource editor for yor main window (or if it is not a dialog, set the style WS_CLIPCHILDREN when creating the window).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi
I open a simple modal dialog box... (from a menu)
And I want to do this:
When the mouse cursor move above a simple component (CEdit, CCheckBox, CComboBox, etc.), I want to display some information about this component fonctionnality (CEdit, etc.) in CEdit with the read-only flag...
The WM_MOUSEMOVE message is sent to the dialog box. Here is the code I use:
void CControlDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CWnd* ThisWnd = ChildWindowFromPoint(point);
int ThisID = ThisWnd->GetDlgCtrlID();
switch(ThisID) {
case IDC_TPG_V_H:
m_strInfoControl = "Test Pattern Generator for incremental test";
break;
default:
m_strInfoControl = "default";
}
UpdateData(FALSE);
CDialog::OnMouseMove(nFlags, point);
}
The m_strInfoControl is the information display into an Edit box read-only component...
The problem is that the dialog box loses the control of the mouse when the mouse cursor is above a component...
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
You could compare the coords or the cursor (the point parameter of OnMouseMove ) with the CRect coords of the control with CRect::PtInRect ... ?
[EDIT] I might have not understand your question : Is it you can't recognize the control where the mouse cursor passes over, or is it you cannot do anything after you recognized it ?
~RaGE();
|
|
|
|
|
This is: I can't recognize the control where the mouse cursor passes over...
Because OnMouseMove is defined for the dialog and not for the component i want to recognize...
Hello World!!!
from Raphaël
|
|
|
|
|
You'll have to override the OnMouseMove for every control, or do almost like I said in the first post (that's bad cheating): Get the CRect from your control, add it 10 pixels or so on every side, so you'll egt a CRect 10 pixels greater than your control, and when the mouse enter this CRect, display your things, when it comes out, undo your display. Tricky, but it should do it. You may also take a look on OnSetCapture to redirect Mouse events.
~RaGE();
|
|
|
|
|
Rage wrote:
You'll have to override the OnMouseMove for every control
It is well what I thought...
Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
I have a DLL file, no .h file, no import library.
In DLL only one function is exported - I know its name.
I need to use this function, but I don't know the
parameters and their types and return value.
Is it possible at all to find this information?
How would do this, if you were in my position?
|
|
|
|
|
Read the documentation ? No other possibility IMO
~RaGE();
|
|
|
|
|
if i get what ure doing, try to find a sample that use that dll, diasemble that exe, and look for the code of this function,and try to mimic it
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I'm working on a MDI application which has a couple of dockable toolbars. When a document loads, I want the childframe to start at a certain height and width depending on the data in the attached document. I don't want to move the child frame; I just want to change its width and height. This is what I tried...
<br />
CRect lChildRect;<br />
pChildWnd->GetWindowRect(&lChildRect);<br />
lChildRect.NormalizeRect();<br />
pMainWnd->ScreenToClient(&lChildRect);<br />
<br />
pChildWnd->MoveWindow(lChildRect->left, lChildRect->top, iNewWidth, iNewHeight, TRUE);<br />
It sets the new width and height correctly but the position is wrong. Depending on how many toolbars are docked to the top or left side of the main frame, the child frame position winds up increasingly offset. It seems that the ScreenToClient() function fails to take into account toolbars but the client area, used by the MoveWindow() function, does take toolbars into account.
How do I get the correct client coordinates for my MoveWindow() call?
|
|
|
|
|
Use SetWindowPos with SWP_NOMOVE flag.
Pavel
Sonork 100.15206
|
|
|
|
|
hi there,
i want to debug my unicode console application.
even when i set break point it does not stop.
can anyone suggest as to what am i missing out.
i am building it in the debug version...
|
|
|
|