|
What then would be the difference between the 5 I think its WM_CTLCOLOREDIT ... STATIC
and the WM_CTLCOLOR (HI_WORD)(Lparam) CTLCOLOR_STATIC, EDIT, BTN
Do they all do/expect the same processing
|
|
|
|
|
The functionality is the same, but WM_CTLCOLOR is a leftover from 16-bit
Windows.
And it looks like there's 6 of them
WM_CTLCOLOR Message[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hello,
i have a main dialog and i need to put a tab control on this,
every tab has own dialog on it, but to avoid to make a too wide main dialog i like to use tab control with more then one row of tabs, like property pages!
But don't now how to start, can someone give me some suggestions how to begin with this problem?
And if is possible with function to disable some tabs(make it Grey)!
TAB TAB TAB // first row
TAB TAB TAB // next row
I have now a simple CTabCtrl, but this can only show one row of tabs,
and without possibility to disable some tabs!
Thanks for any help
termal
|
|
|
|
|
Hi termal,
maybe you could find a multiline tab control here[^].
Best regards,
Mihai Moga
|
|
|
|
|
If I have a timer that is set at an interval of like 1/4 sec to perform actions in FunctionPoll() and if I am inside a function, ImportantCalculations(), what happens to the operations inside ImportantCalculations() when FunctionPoll() encounters a timer?
Do the operations inside ImportantCalculations() finish and then the timer jumps in with FunctionPoll()?
The application I have is built under VS2005 using MFC.
Thanks.
|
|
|
|
|
In a simple single-threaded scenario the answer is basically yes. MFC Timers are as far as I know still exposed via Windows messages. If your timer callback function overruns all that will mean is there will already be another WM_TIMER message waiting on the message queue to get processed wheenever you get to it. The next timer callback will in effect run late and the next and the next. Once you get into a multi threaded situation where timers can effectively interrupt worker threads or start new ones then things very quickly get a lot more complicated.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
i want to get the following detatils for a file
Name
Root
BlockSize
FileSystemSize
AvailableSpace
ReadOnly
EncryptionMethod
CompressionMethod
CaseSensitive
CasePreserved
CodeSet
MaxFileNameLength
ClusterSize
FileSystemType
PersistenceType
OtherPersistenceType
NumberOfFiles
IsFixedSize
ResizeIncrement
is any API is there to get these informations
vineesh
|
|
|
|
|
you can use
GetFileInformationByHandle
typedef struct _BY_HANDLE_FILE_INFORMATION
{
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD nNumberOfLinks;
DWORD nFileIndexHigh;
DWORD nFileIndexLow;
}
BY_HANDLE_FILE_INFORMATION,
*PBY_HANDLE_FILE_INFORMATION;
modified on Friday, July 25, 2008 7:50 AM
|
|
|
|
|
Hello dudes,
I am writing an application which places itself to systray when minmized.
When user right clicks to icon, I pop-up a menu and my problem starts here.
I want to close pop up window when it loses focus, I also wanna catch events from menu.
This is how I open menu:
POINT xy;
GetCursorPos(&xy);
HMENU menu = LoadMenu(this->appInstance, MAKEINTRESOURCE(350));
BOOL b = TrackPopupMenuEx(GetSubMenu(menu, 0),
TPM_RIGHTALIGN|TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RETURNCMD,
xy.x, xy.y, this->getHWND(), NULL);
So how I am supposed to MAP events from menu, i am using MFC?
Thank you all...
|
|
|
|
|
for the first problem: just call setforegroundwindow() before trackpopupmenu().
secondly if u r usig mfc, u can have message map entry for every command and if not then u trap the command in the wndproc().
enjoy
Pras
|
|
|
|
|
Ok I know that but cannot find how to do it?
I create my menu from a resource with id 350.
And here is my message map:
BEGIN_MESSAGE_MAP(CMyWnd, CDialog)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_TIMER()
ON_BN_CLICKED(152, ...)
ON_BN_CLICKED(156, ...)
ON_BN_CLICKED(171, ...)
ON_BN_CLICKED(172, ...)
ON_BN_CLICKED(173, ...)
ON_BN_CLICKED(174, ...)
ON_BN_CLICKED(175, ...)
ON_BN_CLICKED(176, ...)
ON_BN_CLICKED(177, ...)
ON_MESSAGE(WM_USER_SHELLICON, ...)
END_MESSAGE_MAP()
Thanks....
|
|
|
|
|
dehseth wrote: What should I write here to get menu messages?
Typically ON_COMMAND and ON_UPDATE_COMMAND_UI are used for menus.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah I have read a lil bit but I couldnt make it work...
I have tried a map
ON_MESSAGE(WM_COMMAND, Menu_Message)
also
ON_MESSAGE(WM_MENUCOMMAND, Menu_Message)
but still didnt worked!
This is my function which I hope to handle messages:
LRESULT CMemorizerWnd::Menu_Message(WPARAM wp, LPARAM lp)
well in debug mode it never enters to my function.
So I am still looking for a solution for this...
|
|
|
|
|
Maybe remove the TPM_RETURNCMD flag from the TrackPopupMenu() call
and use ON_COMMAND instead of ON_MESSAGE in the message map.
Also, you won't get the command message until TrackPopupMenu() returns.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have written a DLL to encapsulate the Winword interface which works OK but I would like to include all of (or maybe a sub-set of) the methods defined in msword9.h in my DLL without me having to write a wrapper for every method.
This is because I have wrapper functions for the most commonly used things but sometimes I need to do some other less-used thing and I end up having to re-build the DLL. For example I have a GetActiveDoc() method an I would like to be able to use this pointer to call any of the _Document methods.
Is there a way to force the complier to include all functions and methods declared in msword9.h in my DLL build?
Thanks
Tony
|
|
|
|
|
I do not know whether there is any method provided by complier itself. In my project what I have done is added the whole power point class after importing them from the TLB file. You can get how to import all the methods from a TLB from CodeProject.
|
|
|
|
|
I think the simple answer to your question is no. However COM does allow you to do this sort of thing. I'm sure MSWord still exposes COM interfaces and it might be possible to aggregate them with your own wrapper object. In that case anything exposed by Word would be exposed your object. If this sounds like it might help then you'll need to look into COM aggregation.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hi,
Thanks for the reply. Using COM sounds like a workable solution but I have not been able to find any documentation on this - not even in the Office development kit
Any ideas where I might find this information?
Thanks
Tony
|
|
|
|
|
What you are trying to achieve is can easily be done in this way. My project is running fine.
Basically in your interface class you have to derive the classes in this manner.
class MyPPTApplication : public TOleHelper
{
// Operations
public:
LPDISPATCH GetPresentations();
}
This is just a hint how in my project I have achieved this for PPT.
In this way you have to get all the methods for Word, call the method in proper order & you will get the required result. GetPresentations does nothing it internally call this method
LPDISPATCH result = 0;
InvokeHelper(0x7d1, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
I do not know what is the use of you Dll, if it is to show the Word application then you have to create your own container object that is a whole big area in it's respect.
|
|
|
|
|
Hi,
Thanks for the reply. The purpose of my DLL is to wrap the code that you have suggested so that I dont have to do this in my applications. Besides which, the msword9.h documentation is so sparse, I find it can take quite a while to figure out what objects i need, what methods to call and what the parameters mean.
For example, to insert a table into a document, you need need to get all kinds of objects (app, document, selection, range, table) and I dont want to have to do this each time I want to insert a table so I have a InserTable(rows, columns) method.
I guess I could still do what you proposed when I want to do the lesser used objects/methods, I could call them with InvokeHelper.
Thanks
Tony
|
|
|
|
|
Hi all,
How to unselect the selected text in the rich edit control when clicked on selected text?
Manjunath S
GESL
Bangalore
|
|
|
|
|
What you are asking for is actually the default bahaviour.
|
|
|
|
|
I have used the CRicheEditView. I am selcting the character in the editor. When i clcik on the selected character it getting deselected and cursor is moving into begining of the charcter. How to avoid his deselction and movement of cursor?
Raghu
|
|
|
|
|
I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:
void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
{
...
CRect rec;
...
m_myBtn.MoveWindow(rec);
m_myBtn.ShowWindow(SW_SHOW);
m_myBtn.BringWindowToTop();
InvalidateRect(rec);
m_myBtn.RedrawWindow();
}
It works, but I cannot see the button.
If the mouse moves over the button, it shows then I can see it.
I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this??
Thank you in advance !!
|
|
|
|