|
no need of macro ... I can send the message like
m_TreCtrl.SendMessage( 0x00001128,0, RGB(255,0,0));
This will work. Right?
nave
|
|
|
|
|
Naveen R wrote: This will work. Right?
Why do you want to do such things! Just define the proper IE version. That's all.
Well if you have the wrong dll installed no matter what you do it won't work.
Nibu thomas
Software Developer
|
|
|
|
|
But what if it is the dll version problem....?
- NS -
|
|
|
|
|
If the problem is only because of dll version, The program compiles and links with out error.. but will not work...
Because the message will not be handled in that dll
nave
|
|
|
|
|
Hi All
I am making an application which will rename some of the files at system booting(Before windows loading),
For this, making application using Native APIs, because will use this applications's exe in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Boot Execute value to run desired exe after session manager will load.
So I want to know that which NATIVE API is used for Renaming files.
Please reply
Thnaks & Regards
|
|
|
|
|
if you read something in the registry, then windows is already loaded.
if you use a Win32 API to rename files, then windows is already loaded.
if you want to rename a file in pure C/C++, then open your file, read the content, then create another file with the new name, write the content of the other file in it, close them, delete then old file, and you've got it.
|
|
|
|
|
Yuo can use CopyFile and Deletefile or MoveFile APIs.
cheers..mil10
|
|
|
|
|
Thanks for your replies...
Infact I am asking about renaming a file by using Native APIs not by using Win 32 API.
Please reply,
Thanks
|
|
|
|
|
You need to do what v2.0 is saying, to do that using the Native API, you need to use:
ZwCreateFile //To Open and Create the new file
ZwReadFile
ZwWriteFile
Also you'l need a lot of patience, because the Native API is almost not documented.
|
|
|
|
|
did you read my post ?
|
|
|
|
|
rajeevktripathi wrote: I am making an application which will rename some of the files at system booting(Before windows loading),
You can get Windows to do this for you... Call MoveFileEx() while Windows is running, and specify the MOVEFILE_DELAY_UNTIL_REBOOT flag to schedule the rename for the next reboot.
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"
|
|
|
|
|
Why do you think you need to use the Native API just to rename a few files at startup time? Your problem can easily be solved with MoveFileEx(..., MOVEFILE_DELAY_UNTIL_REBOOT) .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Yes
exatctly can do by using MOVEFILE or by SHFileOperation but I need to do it by using Native APIs ( not using Win 32 APIs).
So Please tell me the way to rename a file using Native APIs.
Thanks
|
|
|
|
|
rajeevktripathi wrote: can do by using...SHFileOperation...
No, because by the time a program using SHFileOperation() started, the file being renamed might already be in use.
rajeevktripathi wrote: ...I need to do it by using Native APIs...
Why? What do these functions do that the Win32 API doesn't?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
I have to make a copy of pagefile.sys file,
and we cannt access it because system is using it.
An option I see, is to copy the pagefile.sys file using Native application when session manager loads while booting.
Since Native applications use Native APIs and cannt be run in Win 32 or DOS mode.
Thatswhy I need to rename pagefile.sys file,( so that I could have a copy) and when if Memory management key doesnot find pagefile.sys then it will initialize new one.
So please tell me how to rename file using Native APIs only.
Thanks
|
|
|
|
|
Hi All,
I have implemented Drag and drop from "My NameSpace Extension" (which reflects the actual data in a database server)and Desktop folders. I have handled the CF_HDROP format only in my GetData() function. Presently, it is working only from the explorer right pane. ie user cannot Drag and drop a file in one of the folders in the explorer right pane.
Is there anything extra that I need to do to provide this capability? Do I need to handle some other format also??
Thanks and Regards,
Anil
|
|
|
|
|
I have an activex(simple custom edit) that i place on a dialog. If i call SetWindowPos or MoveWindow of CWnd, the control is moved ok. But if i use SetWindowPos or MoveWindow of the SDK (like ::MoveWindow) the activex is moved in the right position, but after it gains focus it automaticly changes coords to the initial position.
I have tested this with various Activex, even the Microsoft ones. They all behave like this. But i have another activex (i don t have the source code for that ) that behaves correctly.(even if i call ::Movewindow and click on the control it won't go to the initial position).
In short : I have to make my activex not to move back to the initial position on focus gain (after i call ::Move window for ex.)
Thx. in advance.
|
|
|
|
|
I have to manage a part of my user interface (dialogs) in a separate thread.
I've created a CWinThread derived class and I've tryed to show a dialog
in the PreTranslateMessage method but when I close the dialog an
exception is fired.
This is my PreTranslateMessage:
BOOL CTest1Thread::PreTranslateMessage(MSG* pMsg) <br />
{<br />
switch(pMsg->message)<br />
{<br />
case WM_START:<br />
AfxMessageBox(_T("START EVENT"), MB_OK | MB_ICONEXCLAMATION);<br />
break;<br />
<br />
case WM_STOP:<br />
AfxMessageBox(_T("STOP EVENT"), MB_OK | MB_ICONEXCLAMATION);<br />
::PostQuitMessage(0);<br />
break;<br />
<br />
case WM_SHOW_CHILD:<br />
m_pDlgThreadChild = new CDlgThreadChild();<br />
m_pDlgThreadChild->DoModal();<br />
delete m_pDlgThreadChild;<br />
m_pDlgThreadChild = NULL;<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
<br />
return CWinThread::PreTranslateMessage(pMsg);<br />
}
The exception is fired in WINCORE.CPP at this point:
ASSERT(::IsWindow(m_hWnd));<br />
<br />
CHandleMap* pMap = afxMapHWND();<br />
ASSERT(pMap != NULL);<br />
<br />
CObject* p;<br />
ASSERT((p = pMap->LookupPermanent(m_hWnd)) != NULL ||<br />
(p = pMap->LookupTemporary(m_hWnd)) != NULL);<br />
ASSERT((CWnd*)p == this);
<br />
So... I've seen is not easy to manage dialogs in threads...
How can I do that ?
Thanks a lot !!!
|
|
|
|
|
You cannot share GUI elements across different threads, maybe your problem is coming from there. But why do you want to use another thread for that ? And why to manage that in the PreTranslateMessage function ?
|
|
|
|
|
My problem is the following:
a part of the user interface must be sinchronized with an external
interface, some dialogs must be shown when a message is received and must
be blocked until another message is received.
While this part of the user interface is running (pay attention.. it may be
blocked waiting for some events) the rest of the application have to do other
things and Windows messages must be processed. So I supposed to let a separate
thread to manage that part of the user interface in order to don't block
the main thread while waiting for external events.
Do you know what's a good way to solve this problem ?
|
|
|
|
|
It is difficult to help you because we don't know what are those two 'parts' of your app. Is that dialog boxes or what ?
Anyway, I think a better option is to start a thread that will only look for the specific message of the other interface (again, we don't know how they 'communicate' together). Then, when you need to lock a part of the GUI, you send a user define message to the GUI message loop. There, you can manage how the GUI needs to react and you can disable part of it. But again, I cannot help you more without knowing how you manage your GUI. Please post some more information.
|
|
|
|
|
Here I try to give you more information.
My application manages an Ethernet interface with 2 other applications.
It has to send periodic messages and to manage messages received through
Ethernet interfaces. Ethernet interfaces are multi-thread and talks with
the CMainFrame instance through Windows messages so Dialog boxes are
updated with received data when the CMainframe receives the Windows message
sent by Ethernet interfaces threads.
For a specific functionality of my software I have to show and hide some modal
windows when I receive specific Ethernet messages and my flow of operations
must be blocked waiting to next messages. Then I've to send some messages when
the user sets some data and closed the dialog boxes. As you can see, in this case,
the GUI and the Ethernet interface are synchronized in a unique flow of operations.
If it'd be possibile a thread would be the better way to implement this functionality
but I think it is not possible....
Maybe I should let a thread to manage the flow of operations (messages, events,
waits) and post messages to the main thread in order to let it show the dialog
boxes but I've also to use modless dialogs instead of modal dialogs.
|
|
|
|
|
Besides what Cedric said...
Writing code for each message in PreTranslateMessage is dirty. Have message handlers for each of the messages.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks, I know.... the code you have seen is only a test application
written to try to solve my main problem!
|
|
|
|
|
ilgale wrote: solve my main problem
Well we would like to know your main problem. Be more clear. Just specify the main problem and what you want to achieve.
Someone here can suggest you a different solution or an enhanced one.
Nibu thomas
Software Developer
|
|
|
|