|
Why are you not using CFile::SetStatus() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks,
That was indeed the one I forgot about.
Regards,
William
|
|
|
|
|
Hi All,
I just in between of a project.. i need to add some menuitem in the default cut,copy,paste menu.. but problem is that i am not able to get Handle to the Menu so that.. i can add my new sub item...
Could someone give me some pointer to solve this problem.. in brief i want to extend the default Right Click Cut,Copy,Paste menu which come when you right click on any EDIT Box in unmanaged VC++
"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
Support CRY- Child Relief And You
|
|
|
|
|
I know your problem and I think I saw an example that insert items to right click on editbox but i dont know its on www.codeproject.com or www.codeguru.com I search for it if I found I reply to you
|
|
|
|
|
WhiteSky wrote: but i dont know its on www.codeproject.com or www.codeguru.com I search for it if I found I reply to you
my search is't fruitfull today, might be yours
"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
Support CRY- Child Relief And You
|
|
|
|
|
|
WhiteSky wrote: How to modify a CEdit context menu[^]By Mr PJ Arends.
thanks hamid!.. that i am looking for.. thanks a ton!
"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
Support CRY- Child Relief And You
|
|
|
|
|
I glad that your problem solve
|
|
|
|
|
I think that you will have to override the right-click/WM_CONTEXTMENU and provide your own. I do not think it is possible to directly modify the the edit control's menu because I think that menu is built-into the edit control and is a standard feature of Win32 (ever since Win2K or Win9x, I believe).
A global hook can simulate a modification to the shared menu...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
James R. Twine wrote: I think that menu is built-into the edit control and is a standard feature of Win32 (ever since Win2K or Win9x, I believe).
I tried that, but no use?
"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
Support CRY- Child Relief And You
|
|
|
|
|
Hello everybody
I am trying to launch "An All-Purpose Keyboard Hook"(http://www.codeproject.com/system/KeyHook.asp[^]) dll with my application, but not successful... I have no idea why dll doesn't post messages to my application. This is a source code:
***Thread.cpp***<br />
<pre>#include "stdafx.h"
#include "ThreadsApp.h"
#include "KeyHook.h"
IMPLEMENT_DYNCREATE(Thread, CWinThread)
Thread::Thread(){ theApp.FileWrite("Thread constructed\n"); }
Thread::~Thread(){ theApp.FileWrite("Thread destructed\n"); }
BOOL Thread::InitInstance()
{
InstallKeyHook();
KEYENTRY m_entry;
m_entry.nMessage = WM_MYTHREADMESSAGE;
m_entry.hCallWnd = (HWND)Thread::m_hThread;
m_entry.hHookWnd = 0;
m_entry.iCombKeys = 0;
m_entry.iIndicators = 0;
m_entry.iKeyEvent = 0;
m_entry.iMinVKCode = 0x00;
m_entry.iMaxVKCode = 0xff;
if(AddKeyEntry(&m_entry) != KH_OK)
{
theApp.FileWrite("AddKeyEntry failed\n");
return TRUE;
}
theApp.FileWrite("Thread initialized\n");
return TRUE;
}
int Thread::ExitInstance()
{
theApp.FileWrite("Thread clean up\n");
return CWinThread::ExitInstance();
}
void Thread::MyMessageHandler(WPARAM wParam, LPARAM lParam)
{
char data[64] = "";
itoa(wParam, data, 10);
strcat(data, " <<< WPARAM\n");
theApp.FileWrite(data);
}
BEGIN_MESSAGE_MAP(Thread, CWinThread)
ON_THREAD_MESSAGE(WM_MYTHREADMESSAGE, MyMessageHandler)
END_MESSAGE_MAP()</pre><br />
<br />
<code>***ThreadsApp.h***<br />
<pre>class ThreadsApp : public CWinApp
{
public:
ThreadsApp();
void FileWrite(char *data);
virtual BOOL InitInstance();
};
class Thread : public CWinThread
{
DECLARE_DYNCREATE(Thread)
public:
Thread();
virtual ~Thread();
virtual BOOL InitInstance();
virtual int ExitInstance();
void MyMessageHandler(WPARAM wParam, LPARAM lParam);
protected:
DECLARE_MESSAGE_MAP()
};
extern ThreadsApp theApp;</pre><br />
<br />
<code>***ThreadsApp.cpp***<br />
<pre>#include "stdafx.h"
#include "ThreadsApp.h"
ThreadsApp::ThreadsApp()
{
}
void ThreadsApp::FileWrite(char *data)
{
FILE *f;
errno_t err;
err = fopen_s(&f, "C:\\debug.txt", "a");
fprintf(f, data);
fflush(f);
fclose(f);
}
ThreadsApp theApp;
BOOL ThreadsApp::InitInstance()
{
FileWrite("Application initialized\n");
Thread* pThread;
pThread = new Thread();
pThread->CreateThread();
pThread->PostThreadMessage(WM_MYTHREADMESSAGE,1,NULL);
pThread->PostThreadMessage(WM_MYTHREADMESSAGE,2,NULL);
pThread->PostThreadMessage(WM_MYTHREADMESSAGE,3,NULL);
FileWrite("Waiting for the end of thread...\n");
WaitForSingleObject(pThread->m_hThread, 5000);
FileWrite("Program terminated...\n");
return TRUE;
}</pre><br />
<br />
So, what i am doing wrong? :^)<br />
I hope somebody will help :rolleyes:<br />
and thank you very much in advance :rose: :)<br />
<br />
<br />
-- modified at 10:15 Tuesday 31st October, 2006
|
|
|
|
|
Hi
What exactly happens when you run this app? Does the thread freeze when you call pThread->CreateThread();?
Tom
|
|
|
|
|
no, everything runs alright but thread doesn't get messages from *.dll as well as CWinApp can't get messages to...
when message is sent from main application to thread like this:
pThread->PostThreadMessage(WM_MYTHREADMESSAGE,3,NULL);
then everything is alright well almost everything but other issue doesn't matter while i am not getting messages from dll...
this is a dll implementation in thread or how to call that
m_entry.nMessage = WM_MYTHREADMESSAGE; // Our message ID
m_entry.hCallWnd = (HWND)Thread::m_hThread;// Send message to this window
i am not sure if this is right parameter to give for dll (HWND)Thread::m_hThread ?
in the original example it gives m_hWnd i think it is CWnd::m_hWnd its window handler, because dll sends a message into "Graphical" window, i don't want that window, i want invisible application, so creating CWnd class dosn't fits for me i think...
-- modified at 12:57 Tuesday 31st October, 2006
|
|
|
|
|
This line is a problem:
<br />
m_entry.hCallWnd = (HWND)Thread::m_hThread;<br />
In the file KeyHook.cpp the value hCallWnd is used in the function who's prototype is below to send a message to a window via a call to PostMessage. There is no way a thead handle will suffice in such a situation.
<br />
LRESULT CALLBACK KeyboardProc(INT nCode, WPARAM wParam, LPARAM lParam)<br />
Either, modify KeyHook.cpp to use PostThreadMessage or use a window to receive the messages.
Regarding windows, wanting an invisible app is no barrier to using a window in this instance. When you create the window call either ShowWindow or SetWindowPos to make it invisible. This will basically make the window just an easily used message loop, ideal for your purposes.
Tom
|
|
|
|
|
thank you for advice
i will try to create invisible window
|
|
|
|
|
Are there any alternatives to using SetWindowRgn() to create a rounded window. Or is there any way to speed up the process. There is too much flicker for my liking when the window is being resized and a new region has to be set.
|
|
|
|
|
waldermort wrote: There is too much flicker for my liking when the window is being resized and a new region has to be set.
handle OnEraseBkgnd method
"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
Support CRY- Child Relief And You
|
|
|
|
|
On Win 2K and later you can use a layered window. I haven't used it personally, but IIRC one of the goals of layered windows was to be faster than regioned windows.
|
|
|
|
|
Thanks for the tip, I will give it a try.
|
|
|
|
|
Hi every body,
I now try to develop an application that can help the administrator monitor user file operations such as copy, delete, rename... but I don't know how and where to start. Could you please show me how to.
Thank you for your kind help.
|
|
|
|
|
TPN wrote: ...monitor user file operations...
From where?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
TPN wrote: I now try to develop an application that can help the administrator monitor user file operations such as copy, delete, rename... but I don't know how and where to start. Could you please show me how to.
look at ReadDirectoryChangesW api
"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
Support CRY- Child Relief And You
|
|
|
|
|
How can I compile my program in 2 or 3 different languages using visual studio??
The main problem is the resources file (.rc): how can I, for example, use the same menu with the same IDs, changing only the strings (whithout re-write everything)
Is there a way??
Cheers,
Russell
|
|
|
|
|
in the property of your menu, check the language. then you can duplicate the resource, and set a language for each.
|
|
|
|
|
tnx tox,
... but 2 precisations:
1- to choose the desired menu during the compilation shell I ONLY set the language on the property Resource/General/Language
2- I suppose that in this way every time that I add a new menu item it appears only on the selected menu', not on the others...right??
Cheers,
Russell
|
|
|
|