|
The above code sets the window portion (painted by COLOR_KEY) transparent and click-through properly. Please check whether the actual color (used to paint the window) is plain (doesn't include any shade/shadow of COLOR_KEY) color.
|
|
|
|
|
Thanks Malli_S for your quick reply.
The actual color you mentioned is indeed the color key I set in SetLayeredWindowAttributes().
The evidence is that I don't see the colored parts (it is transparent, but unfortunately not click-through)
Thanks
|
|
|
|
|
Do a small test. Open the Notepad and put it behind your application's transparent area. And check whether the cursor changes to 'I'. This is because the specified color code does make window transparent but not the shade of color it has. If on any of the point, the cursor doesn't change, indicates the presence of the other color on that pixel. I just tested the same thing by changing the color into slight shady.
|
|
|
|
|
Actually shading doesn't work here at all. Because it's one color key (as opposed to alpha channel for instance), and a unique one, every pixel not in that color will be visible.
In my situation, I am using a window as a child control of IE. This makes click-through verification quite easy. The color-key colored parts are fully transparent and therefore I can see the IE page content behind it. However, clicking on hyperlinks for example is impossible.
Any ideas?
Thanks again
|
|
|
|
|
Hi,
How can I disable the message 'Failed to Launch Help' for unhandled help IDs in an MFC application and Dispalay default page of the help file? this message is displayed when I press Shift+F1 on some buttons which I've not added help for them.
|
|
|
|
|
try overriding
void CWinApp::WinHelp(DWORD dwData, UINT nCmd);
all help events eventually are handled there.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
AfxHtmlHelp is being called inside of it. I can not call it. linker says unresolved external symbol. Do you know what should I do?
|
|
|
|
|
I checked in Google and I couldn't find this function AfxHtmlHelp. Are you sure it's not just HtmlHelp?
Anyway, you override CWinApp::WinHelp, so what's called inside is what *you* choose to call. Why are you trying to call AfxHtmlHelp?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
CWinApp::WinHelp is calling pMainWnd->WinHelp(dwData, nCmd). So it is better to override CMainFrame::WinHelp
void CMainFrame::WinHelp(DWORD dwData, UINT nCmd)
{
HtmlHelp(m_hWnd, AfxGetApp()->m_pszHelpFilePath, HH_HELP_CONTEXT, nCmd == HELP_CONTEXT ? dwData : 0);
}
|
|
|
|
|
Test your application with "HTML Help Workshop". Activate "HTML help messages" in the view menu.
Collect the data for the missing HID_ messages. Create a default page in your helpfile and create aliases for the missing HID_ messages to this page. The best you can put them in a include file under the [ALIAS] and [MAP] key.
[ALIAS]
#include MissingHelp.h
[MAP]
#include MissingHelp.hm
In MissingHelp.h you can put things like:
HID_SYSTEM_EXIT = default.html
HID_SYSTEM_MAX = default.html
HID_SYSTEM_MAX_NORMAL = default.html
HID_SYSTEM_MIN = default.html
HID_SYSTEM_MOVE= default.html
In MissingHelp.hm you can put things like:
#define HID_SYSTEM_MOVE 0x1EF01
#define HID_SYSTEM_MIN 0x1EF02
#define HID_SYSTEM_MAX 0x1EF03
#define HID_SYSTEM_EXIT 0x1EF06
#define HID_SYSTEM_MAX_NORMAL 0x1EF12
|
|
|
|
|
Theo Buys wrote: The best you can put them in a include file under the [ALIAS] and [MAP] key
Can I use #include and #define statements in HTML Help Workshop projects? What should I do to be able to do that?
I have a project where we have different versions (like a Demo and a Full version), and it'd be nice to be able to change the program name according to which version I'm building, without 2 separate html help projects where this is the only difference.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Hi all.
in preview window many buttons are present like,
Print,NextPage,PrevPage,ZoomIn,ZoomOut,Close.
i want to hanle the Close button.
please tell me how can i handle it.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
There is a function called CDC::IsPrinting
When you try to close the preview window OnClose function will be called and you can check whether you have closed the window through print preview by checking the IsPrinting Flag .
|
|
|
|
|
No its not working please explain with example
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi there is a virtual function called OnEndPrintPreview
void CExamp1View::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView)
{
AfxMessageBox ("Data");
CView::OnEndPrintPreview(pDC, pInfo, point, pView);
}
use this i will sure it will work
|
|
|
|
|
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi All
Removable hard disks ( USB hard disk ) are being displayed even when selected drive type is Local Disk. This problem doesn't occur with removable flash drives.
How can i show Removable hard disks ( USB hard disk )is a Logical Drive?Plz help me
|
|
|
|
|
Hello All,
I am doing an SDI application in MFC(.Net 2008 platform). In my project, when i click on any button, i have to create a child window in the mainframe window. This child window having no caption, title bar, system menu. i want only border for that window. This child window will always be displayed on the Mainframe window, even i click anywhere on the mainframe window.
I have created window using Create() function and Set its position using SetWindowsPos() function. as follwing;
**************************
CFrameWnd* pFrame ;
pFrame = new CFrameWnd;
pFrame->Create(NULL,NULL, WS_OVERLAPPEDWINDOW ,rect,NULL,NULL,0,poContext);
pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW + WS_TILEDWINDOW, WS_BORDER,SWP_+ SWP_NOMOVE +SWP_NOZORDER );
pFrame->InitialUpdateFrame(pDocument,TRUE);
pFrame->SetWindowPos(&CWnd::wndTopMost,x,y,x1,y1,SWP_SHOWWINDOW);
pFrame->ActivateFrame(SW_SHOWNORMAL);
**************
Now the problem is that, when i minimize the Mainframe window, child window always be there on the screen. i want to minimize this child window also along with Mainframe window. How can i do this. Please give me any hint with the help of code.
Which flag i have to set while creating the window or in the SetWindowPos() function.?
Also when i create child window, its name is displayed on the taskbar, when it is created. I dont want to show this entery on the taskbar.
Thnaks in advance.
|
|
|
|
|
i have a dialog box and in dialog box there r 4 check boxes.whenever check box is checked it becomes 1 and for unchecked, value becomes 0.so user may check or uncheck the check boxes according to that i need to get the values of check boxes and i need to convert it into decimal.
eg 1)if 1st and 2nd checkboxes are clicked then it will be as 1100
2)if 1st and 4th check boxes are checked then it becomes as 1001 and
3)if 2nd check box is checked then it becomes as 0100
i want to convert this value to decimal, how can i do this?
thanks in advance.
|
|
|
|
|
You just need to obtain the state of the check box and use some simple bitwise operations. You'll want to do something like this:
int myNumber = 0;
if (checkBox4.isChecked()) myNumber &= 1;
if (checkBox3.isChecked()) myNumber &= 2;
if (checkBox2.isChecked()) myNumber &= 4;
if (checkBox1.isChecked()) myNumber &= 8;
How you determine the checkbox's state is up to you.
|
|
|
|
|
enhzflep wrote: You just need to obtain the state of the check box and use some simple bitwise operations. You'll want to do something like this:
int myNumber = 0;
if (checkBox4.isChecked()) myNumber &= 1;
if (checkBox3.isChecked()) myNumber &= 2;
if (checkBox2.isChecked()) myNumber &= 4;
if (checkBox1.isChecked()) myNumber &= 8;
Two notes:
- AFAIK there's no
isChecked method available (even CMFCButton has IsChecked , i.e. starting uppercase). - The correct bitwise operator is OR (
| ), instead of AND (& ).
Be careful when proposing code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi there,
i'm trying to set up a hash map such as:
class ObserversByMessageMap :
public stdext::hash_map<messagekey,>
{};
and i've got MessageKey defined with these operators:
bool operator==(const MessageKey& other)const;
bool operator!=(const MessageKey& other)const;
bool operator<(const MessageKey& other)const;
bool operator>(const MessageKey& other)const;
operator size_t(void)const;
something doesn't work quite right however. i'm trying to do something like:
MessageObserverSet& observers = (*m_observersByMessageMap)[key];
observers.insert(observer);
but it appears that the map (either hash or map) seems to collide with a *different* key than what i expect, and therefore adds the observer to the wrong pre-existing key.
i figured the operator==() is supposed to prevent that from happening, but it aint being called. instead the size_t hash is called and also the < operator, which i've defined as:
bool
MessageKey::operator<(const MessageKey& other)const
{
bool lessThan = false;
if(m_messageId <= other.m_messageId)
{
if(m_objectId < other.m_objectId)
{
lessThan = true;
}
}
return lessThan;
}
since m_objectId is a nested object.
any ideas? in mfc this kind of stuff worked no problem...
|
|
|
|
|
My directory structure is like the following
Solution Directory
--Project1
--Project2 From Project2 , I have to use classes written in Project1 . I have included the header files like the below in Project2
#include "../Project1/SomeHeader.h" I can see the classes in intellisense but the problem occured with linker. It is saying about unresolved external symbols.
I am looking for a method to link the file to Project1 . Any thoughts?
EDIT:
I solved it by adding the project dependencies. Right click on the project -> Project dependencies -> Check the Project1 , save and build.
I'd like to hear from you guys that is this the right approach to solve the above described problem?
Thanks
modified on Monday, December 29, 2008 11:25 PM
|
|
|
|
|
What kind of projects are Project1 and Project2 ? Is Project1 a library ? If yes, then your approach is the correct one (of course you need to add the library in the project settings of Project2).
|
|
|
|