|
Dear Everybody,
I want to make my application can get a file name when i hook mouse at a known position.I have a idea that write a shell dll that capture file name when a mouse click event happened, then put file name to a shared memory with my application.Is is possible?If anyone show me other way to do, I would very appriciated.
Thank you in advanced.
|
|
|
|
|
In a dialog form there are three three edit boxes which and button.
The member variable of three edit boxes are of integer types.The three edit boxes represent the RGB color.Suppose if I click the button which on the form background color of the dialog form should according to the value entered the three edit boxes which are present on the dialog form.
The changing of the background color is given below
HBRUSH CBackColor1Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
if( pWnd == this)
{
pDC->SetTextColor(RGB(100, 255, 111));
pDC->SetBkColor(RGB(255, 255, 255));
hbr = (HBRUSH)(m_pBlackBkBrush->GetSafeHandle());
}
return hbr;
}
The code for the button control is given below
void CBackColor1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
}
Can any one please tell how to integrate OnCtlColor member function with onButton1() member function .
Philip
|
|
|
|
|
if(pWnd->GetDlgCtrlID() == IDC_BUTTON1)
{
}
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
I guess you need to go through some of the basic Visual C stuff. For this, the best approach is to follow some basic level book. This will revise your concepts and make you a better programmer overall. Remember, Hit and Trail does not work always. You are trying to learn the Hard Way.
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
Hello ,
I am involved in automating keyboard keys in Client and to retrieve their states in Server .
I used keybd_event function to set the keys in client and
GetKeyState function to retrieve the state of the keys in the server.
Now when i run the client and server in the same machine , there is no problem .
But when i run the Server in different machine, the problem arises. Our tool is remote management tool where keyboard , video , mouse everything can be redirected. So when the user press the key in the client machine ,in the server also tat key will be pressed. But when i try to get the key state in the server , it tells that the key is not pressed.
Plz help me what other functions can be used other than keybd_event and GetKeyState can be used to set and retrieve the keys...in keyboard
|
|
|
|
|
are there some c++ functions used for checking serial numer of a CD?
thx
includeh10
|
|
|
|
|
|
can any tell me how change the background color of a button ?
Can anyone help me in this matter.
Philip
|
|
|
|
|
|
You beat me By 1 Sec , MY Typing and Net Connection are getting Slower day by Day
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Modify the Style of Button to Owner Draw and in OnCtlColor , as i told last day
look for ID of CTLCOLOR_BTN in UINT nCtlColor
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Selvam
|
|
|
|
|
Can any one tell me the use of "this pointer" in vc++?
//
if(pWnd == this)
//
In the above code, what is the signifance of the above code ?
Philip
|
|
|
|
|
Hi,
"this pointer" use to point the current object.
if(pWnd == this)<br />
In above code check the current object is pWnd(Window) object.
Regards,
Selvam
|
|
|
|
|
phijophlip wrote:
Can any one tell me the use of "this pointer" in vc++?
See here.
phijophlip wrote:
if(pWnd == this)
//
In the above code, what is the signifance of the above code ?
It is comparing two objects to see if they are equal.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all:
After I run the GrafMenu example in chapter The GDI bitmap object(Programming Windows), I can not achieve the correct result.There's no graphic appearing in menu.
When I debug this example, I found that the function StretchBitmap() return a NULL Bitmap handle! But what causes it?
|
|
|
|
|
I have a dialog with the ID IDD_RESULTSDLG, I derived a class called CResultsDlg from CDialog that calls that dialog. It's a simple dialog, has 8 static text areas and an okay button. I have overloaded the constructor to pass 3 integers and a float. I run it by issuing these commands:
CResultsDlg * myResults;
myResults = new CResultsDlg(offsetWidth, myBitmap->getHeight() * myBitmap->getWidth(), myOutput->getBytesWritten(), compression);
myResults->DoModal();
The constructor takes the arguments and simply sets 4 out of 8 static texts to those numbers.
It compiles fine, but I get a runtime error box:
Debub Assertion Failed!
(path to executable...)
File: dlgcore.cpp
Line: 491
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
I press retry and it brings up another window:
Unhandled exception at 0x7c205d2c (mfc70d.dll) in 489gui.exe: User breakpoint.
I can press continue and it continues running but doesn't show that dialog or I can break it.
It also brings up the file dlgcore.cpp and puts the cursor at dlgcore.cpp, line 491:
ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL || m_lpDialogTemplate != NULL);
In debug, when it reaches that line, VS tells me all three are NULL. Did I miss a step when I'm trying to do this? Can I not overload the constructor or am I doing it wrong? I can call the dialog using the default constructor and it comes up without any error. Any help would be greatly appreciated.
|
|
|
|
|
you probably forgot to initialise the CDialog base class in your CResultsDlg class constructor.
Regards,
Serge Krynine
|
|
|
|
|
ah-ha, I must have missed that little detail, good call. I get the dialog fine but the data in the static text isn't being set properly. Here's my constructor code:
CResultsDlg::CResultsDlg(int offsetWidth, int uncompressedSize, int compressedSize, float compressionRatio) : CDialog(CResultsDlg::IDD, NULL)<br />
, offsetWidthInt(0), uncompressedSizeInt(0), compressedSizeInt(0), compressionRatioFloat(0) {<br />
offsetWidthInt = offsetWidth;<br />
uncompressedSizeInt = uncompressedSize;<br />
compressedSizeInt = compressedSize;<br />
compressionRatioFloat = compressionRatio;<br />
UpdateData(FALSE);<br />
}
offsetWidthInt, uncompressedSizeInt and compressedSizeInt are all integer variables that I made to change the appropriate static text, same with the compressionRatioFloat but it's a floating point number of course. I put the UpdateData(FALSE); because I used it when I (tried to) learn(ed) how to do data exchanges between dialogs and thought it might be what I'm missing but that's not it. Anyone know what I'm not doing or not doing right?
|
|
|
|
|
Dialog and controls are not valid until DoModal is called.
Add the OnInitDialog function to your dialog class.
Call the UpdateData(FALSE) from there if you think you must (though you will find it is already called for you).
You need to store the data passed to constructor in member variables, and then tranfer data from member variables into controls in the DataExchange member function - this can be done for you nearly automatically if you use ClassWizard to associate member variables with the static text controls.
|
|
|
|
|
How to decode MPEG video and audio?
Is there any source code?
Thanks!
|
|
|
|
|
what exactly is your need in mpeg layer??
if its mpeg1 layer3 then i could help you in case of audio.
|
|
|
|
|
Hello!
I am a absolute beginner!
I found a source here about HOOK - realized with DLL. I use it in my app to wait for key_down. But I have problem. I want my app to come to the top, when the CALLBACK-procedure has identified a key press. How can I do it easily?
My code in the DLL:
<br />
HWND g_hWndMain;<br />
<br />
LRESULT CALLBACK Keyboard( int code, WPARAM wParam, LPARAM lParam )<br />
{<br />
if (code==HC_ACTION) <br />
{<br />
LPEVENTMSG lpEvent= (LPEVENTMSG)lParam; <br />
if( lpEvent->message == WM_KEYDOWN && LOBYTE(lpEvent->paramL) == VK_F1 )
{<br />
MessageBox( NULL, "CTRL + F1 pressed!", NULL, NULL );<br />
SetForegroundWindow(g_hWndMain);
}<br />
}<br />
return ::CallNextHookEx(g_hHkKeyboard, code, wParam, lParam);<br />
}<br />
<br />
__declspec(dllexport) BOOL IdleTrackerInit(HWND hWnd)<br />
{<br />
if (g_hHkKb == NULL) <br />
{<br />
g_hHkKb= SetWindowsHookEx( WH_KEYBOARD, KeyboardTracker, g_hInstance, 0 );<br />
<br />
}<br />
<br />
<br />
_ASSERT(g_hHkKb); <br />
<br />
if (!g_hHkKb)<br />
{<br />
return FALSE;<br />
}<br />
else <br />
{<br />
g_hWndMain = hWnd;
I don't know if the code line:
SetForegroundWindow(g_hWndMain); // set the main window to the top
is right or wrong!
If it is ok, how can I give the main window to the parameter HWND hWnd ????
|
|
|
|
|
can some please tell me it the HOURS seem right for these estimates for a bejeweled concept game. thank you. game graghics provided by client.
Activity........................................stimated hours........Hourly Fee......Price
Application design...........................................60...........17.1.......1026
Java class BeJeweled and algorithm for playing....160...........13.7.......2192
Graphic images for Jewels and other elements........0............13.7............0
Special sparks effect (dispalyed time intervals).....30............13.7.........411
Special effect on mouse over...........................20..............13.7........274
Special effect on mouse click...........................20...............13.7........274
Special effect on score...................................20...............13.7........274
Special effect on moving pieces........................60...............13.7........822
Special effect on Bonus..................................20...............13.7........274
New Game/Simple/Timed/Mute buttons...............4................13.7........55
Pause game..................................................8................13.7........110
Music.........................................................16................8.2.........131
User help....................................................12................8.2.........98
Testing ......................................................24...............8.2.........197
Installation & instructions...............................12..............8.2...........98
Total price.................................................................................6236
1st Time Buyer Discount.................................................................374
Price after discount......................................................................5862
dee
|
|
|
|
|