|
Is there anyway to know which lib to link when you get a linker error for unresolved errors
eg error LNK2001: unresolved external symbol __imp__ShellExecuteA@24
LNK1120: 1 unresolved externals
Which library do I need to link to for SHELLEXECUTE to work.
(I have to add it to a makefile )
---
|
|
|
|
|
shell32.lib
You can find information like that at msdn.microsoft.com.
|
|
|
|
|
I have a multiline edit control on a dialog and I disable it with EnableWindow(FALSE). My problem is that I want the text to be a different color but it stays the grayed out disabled color. I would be open to not disabling the box but that would give me three additional problems. a) I'd have to make sure it could never get focus, b) I'd have to change the mouse cursor from the I-beam to the arrow, and c) I'd have to make sure text couldn't be selected.
Any Suggestions are welcomed
-Jack
|
|
|
|
|
What about making it read-only.
I dont know why you wouldn't want someone to be able to select the text in the edit control, maybe they would want to copy that data to the clipboard for another app.
|
|
|
|
|
Read only still allows the textbox to have focus. Disabled does exactally what I want except for the text color.
-Jack
|
|
|
|
|
I've decided to do this by using a read only box. I handle the EN_SETFOCUS message to give focus to another control so this control can't have focus. What message do I have to handle to change the default mouse cursor?
-Jack
|
|
|
|
|
|
How do I cancel the ESCAPE key in a modeless dialog...?
Do I override OnCancel or PreTranslateMessage or perhaps something totally different...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Create a handler for the WM_CHAR message inside of the PreTranslateMessage function, because the ESCAPE key is processed in the IsDialogMessage function for a dialog. This is the function that dispatches the message to the window, therefore you will have to process the WM_CHAR message before this function is called.
|
|
|
|
|
Thanx Kilo!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
According to my experience, I would like to override OnCancel() function to handle the key event. It makes your program a little easier to use and fewer codes also.
|
|
|
|
|
Does that actually work...? can you just return false in OnCancel to prevent escape from doing it's thing...?
In anycase...it's pretty hard to beat:
if(pMsg->message==WM_KEYDOWN){
if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE) return TRUE;
}
Thats easy enough for me.
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Misunderstanding, friend! I means that I will let the user press esc to quit after I release every resources in OnCancel() function. I donnot want to forbid this feature. I was not talking about coding but a solution. And Thanks your code also.
|
|
|
|
|
The way I do this is by overriding OnCancel() such as:
void CMyDlg::OnCancel() {
GetAsyncKeyState(VK_ESCAPE);
if (!GetAsyncKeyState(VK_ESCAPE)) {
CDialog::OnCancel();
}
}
|
|
|
|
|
Happy birthday HockeyDude!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Thank you kindly.
To be honest I totally forgot about that...
I guess I should go ask friends/family for gifts now?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I create Folder, but then i draggin class in - class is copy
How move class to folder????
|
|
|
|
|
Drag with right mouse button - this will open popup menu with Copy and Move options when you drop.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
May be I must for each Toolbar button create Menu Item?
|
|
|
|
|
I want write a Thread to read and receive data from LPT port. Could someone help me?
|
|
|
|
|
I want to add a item to the right-click popup menu wherever the edit-lick control, which can belong to any program instance.
I thought there are two ways maybe, one is change the registry, like some "shell extending" articles in codeproject; two is hooking.
But I never touch those two domain before. Can you give me some suggestions? I've got the base info of hooking, but have no good info or source-code of mouse hooking. I have no info of registry.
Thanks ahead!
with Best Regards,
Kamp Huang
|
|
|
|
|
You can do that with local superclassing.
Subclassing is where you replace the windowproc of a window or control after it is created.
Local Superclassing is where you register a new class in your process that has the same name as one of the controls that have already been defined. When windows attempts to create a new control that has been superclasses, it will look in the local class definitions before it looks in the global definitions.
Here is an example of the code that you can add to make it so that every time that you hit a key in the edit box, a beep will sound. You can make the changes to do what you need to do.
WNDPROC lpfnEditClassProc = NULL;
LRESULT CALLBACK LocalEdit_WndProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
if (msg == WM_CHAR ) {
MessageBeep(-1);
}
return CallWindowProc(lpfnEditClassProc, hwnd, msg, wParam, lParam);
}
BOOL CreateLocalEditClass()
{
WNDCLASS wc;
if ( lpfnEditClassProc == NULL ) {
GetClassInfo(NULL, "Edit", &wc);
lpfnEditClassProc = (WNDPROC) wc.lpfnWndProc;
wc.lpfnWndProc = LocalEdit_WndProc;
wc.lpszClassName = "Edit";
wc.hInstance = _hInstance;
if (!RegisterClass(&wc))
return FALSE;
return TRUE;
}
}
void DeleteLocalEditClass()
{
if ( lpfnEditClassProc != NULL ) {
UnregisterClass("Edit", _hInstance);
lpfnEditClassProc = NULL;
}
}
If you need to change every edit control in windows to do what you want, you can look into global superclassing, but this is generally not a good idea.
|
|
|
|
|
Oh! New idea! I never thought of that before! But I really need to detect every edit-like controls to get the user selected text. I found that there are some many edit-like control with various class-name. Can I superclassing without specified a class-name? I wondered that. Hooking maybe the best way to do the tast. Thanks anyway!
|
|
|
|
|
Hi guys
I want to write a code which register a program in windows, which start up at log on. I mean target program should start up at the time of log on. and also a way to delete this registered program.
How can i do it?
regs
rohit
|
|
|
|
|
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|