|
add code in OnInitDialog
SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
HINSTANCE hInst = LoadLibrary(_T("User32.DLL"));
COLORREF color1= RGB(0,255,0);
if(hInst)
{
typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);
MYFUNC fun = NULL;
//取得SetLayeredWindowAttributes函数指针
fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(fun)fun(this->GetSafeHwnd(),color1,160,2);
FreeLibrary(hInst);
}
can make dialog transparence .The control also become transparence too, how to do that i need transparence dialog and opacity control.
|
|
|
|
|
Hi,
I am trying to get emails from outlook using outlook automation.
To access the MAPI function I have to import 2 files
1.mso.dll
2.msoutl.olb
But for different version of outlook, they are on different path.
But #import is compile time macro. So i am confused how to import/reference of these files at run time.
Please guide me how to do?
|
|
|
|
|
Here's how I #import Excel:
#import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")
Note the use of libid - that's constant across different versions and independent of the location of the file implementing the library.
The libid can be determined using the OLE-COM Object Viewer. Either open your DLL or OLB using the File->View TypeLib command or find the Outlook type library in the Type Libraries node of the tree-view.
As I'm a nice guy:
MSOUTL.OLB = 00062FFF-0000-0000-C000-000000000046
MSO.DLL = 2DF8D04C-5BFA-101B-BDE5-00AA0044DE52
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
i want to send very big string in command line parameter but its not working so i think i break this string small parts and put in a array and than pass the array.
so please tell me can i do this.
or if not please tell me any other method for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: i want to send very big string in command line parameter but its not working so i think i break this string small parts and put in a array and than pass the array.
So, you're still stuck with that? Did I not tell you yesterday that passing a 70K+ long string as a command line is a very bad idea (leaving alone if it's possible or not)? May be you should read it again?
"_$h@nky_" wrote: so please tell me can i do this.
I provided a link to the page which discusses about this yesterday, which clearly pointed out the maximum length of the string that can be passed on as command line parameter. Did you read it or not?
"_$h@nky_" wrote: or if not please tell me any other method for this.
Put it in a file and read it after the application starts up? Like I said yesterday...
It is a crappy thing, but it's life -^ Carlo Pallini =
|
|
|
|
|
i hope the path in the command line parameter is less than 260?
if it is less than 260, can you please share the command line text.
Величие не Бога может быть недооценена.
|
|
|
|
|
I have now been strugling since several days, but I can't get my tooltips to show. I have a CFrameWnd that I dynamically create, which contains a CToolBar for which I want tooltips to show up. Here is what I have so far:
CFrameWnd creation:
HINSTANCE aa=AfxGetInstanceHandle();
LPCTSTR theClass=AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_OWNDC|CS_DBLCLKS,0,0,LoadIcon(aa,MAKEINTRESOURCE(IDR_MY_ICON)));
MyCFrameWnd->Create(theClass,"MyAppName",WS_TABSTOP|WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS);
CToolBar creation (in MyCFrameWnd):
EnableDocking(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM|CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT);
MyCToolBar=new CToolBar();
MyCToolBar->CreateEx(this,TBSTYLE_FLAT,WS_CHILD|WS_VISIBLE|CBRS_SIZE_DYNAMIC|CBRS_TOP|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|CBRS_TOOLTIPS);
MyCToolBar->LoadToolBar(IDR_TOOLBAR);
MyCToolBar->SetWindowText("Navigation");
MyCToolBar->EnableDocking(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM);
MyCToolBar->SetButtons(toolbarStruct(containing command IDs),toolbarItemNb);
MyCToolBar->SetButtonStyle(MyCToolBar->CommandToIndex(TOOLBAR_CMD_1),TBBS_CHECKBOX);
... (similar for the other buttons as above line)
DockControlBar(CMyToolBar,AFX_IDW_DOCKBAR_TOP);
Then for every toolbar image in the toolbar editor, I added the tooltip text under "Prompt" (in the properties view). e.g. "hello world\nhello world"
Finally, my MyCFrameWnd has a custom message handler (WindowProc) and at the end of that routine I call:
return (CFrameWnd::WindowProc(uMsg,wParam,lParam));
When I look at messages that my toolbar generates/receives (using spy++), I cannot see any WM_NOTIFYFORMAT, WM_NOTIFY or WM_TIMER like other applications showing tooltips.
Does anyone have a small clue why my tooltips don't show?
modified on Monday, August 31, 2009 11:44 PM
|
|
|
|
|
use SetLayeredWindowAttributes set a dialog .
but i don't want the button and title to be transparent too.
how to do?
|
|
|
|
|
This happens because the dialog background and the button face have the same color value.
You could change the background color of the dialog so that it is slightly different from that of the button face.
Now you can specify the dialog background color as the second parameter to SetLayeredWindowAttributes .
You can change the dialog background color by handling the WM_CTLCOLORDLG[^] notification or if you're using MFC you can use CWinApp::SetDialogBkColor[^] function.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hi everybory.
I using VC++6.0. if I have font name and font size of text => text height and text width ?
hope everybody help for me.
thanks very much.
nothing
|
|
|
|
|
You can use the GetTextMetrics[^] function to get the font height and width.
First get a handle to the font using CreateFont[^] or CreateFontIndirect[^].
Then create a device context using GetDC[^] and select the font into the device context using SelectObject[^].
Now you can use GetTextMetrics on the device context handle.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi, every one:
I have a problem with the underline style of richedit.let me descrip it in detail:
1,I input "abc" in richedit.
2,Then, i set only "c" with underline style."ab" remains the old style.
3,I select "abc" and set the bold or italic style to all of them.
4,"abc" has the style of bold or italic, and all the three characters have the underline style.This is confusing.The reasonable result is only the "c" has the underline style.
the code snippet i use is:
//set underline style
INT nStart, nEnd;
SendMessage( EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd, NULL );
CHARFORMAT2W cf;
ZeroMemory( &cf, sizeof( cf ) );
cf.cbSize = sizeof( cf );
SendMessage( EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
cf.dwMask |= CFM_UNDERLINE;
cf.dwEffects |= CFE_UNDERLINE;
SendMessage( EM_SETSEL, nStart, nEnd, NULL );
SendMessage( EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
//set bold style
INT nStart, nEnd;
SendMessage( EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd, NULL );
CHARFORMAT2W cf;
ZeroMemory( &cf, sizeof( cf ) );
cf.cbSize = sizeof( cf );
SendMessage( EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
cf.dwMask |= CFM_BOLD;
cf.dwEffects |= CFE_BOLD;
SendMessage( EM_SETSEL, nStart, nEnd, NULL );
SendMessage( EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
Is there any bug in my code?please help me.
|
|
|
|
|
I solved this problem today just now, the CHARFORMAT works. it is confusing too for me.
Is this a bug of richedit?
|
|
|
|
|
Hallo, i have an SDI-Application it is View class derived directly from CView, i need tob e able to change the output in it or to move the cursor with ctrl+pos1 or ctrl+end .Important: I can not use the class CRichEditView instead of CView to drive the View of my application. Thanks.
|
|
|
|
|
The text you can change with SetWindowText[^].
You can move the blinking cursor using SetCaretPos[^].
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
The problem is i do not have a blinking cursor., because this is a view derived from CView calss.
|
|
|
|
|
Did you try calling SetCaretPos ?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
susanne1 wrote: Important: I can not use the class CRichEditView instead of CView to drive the View of my application.
And what about the CEditView[^] ?
If you implement directly from CView, you don't have any support for text (so, no cursor neither) or you will need to implement it yourself.
|
|
|
|
|
You need to do what ? a text editor ? and you cannot use either CEditView or CRichEditView ?
This signature was proudly tested on animals.
|
|
|
|
|
i need to print out the results of a database query, a class derived directly from CView is the only suitable possible solution till now i had before classes derived from CRichEditView and CEditView buut i hhad a lot of disadvanteges and ristrictions with them.
|
|
|
|
|
Stick an edit control in the view, occupying all of the view. (Which is, for all intents and purposes, what CEditView does, so why not use it?)
|
|
|
|
|
susanne1 wrote: Important: I can not use the class CRichEditView instead of CView to drive the View of my application.
Why? This restriction severly limits, if not eliminates altogether, your options.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I dont think, it is good to use CView instead of CEditView or CRichEditView.
If you can derive a class from CView then you have handle SetCaretPos, SetWindowText and all to get the text support as suggested by earlier posters.
Величие не Бога может быть недооценена.
|
|
|
|
|
1/ Your question isn't really about SDI - it would be equally true from MDI too.
2/ If you're not allowed to use a Richedit control, maybe just a simple CEDitView?
3/ If you can;'t use that... then how about:
Crystal Edit - syntax coloring text editor[^]
It's not trivial to use, but I've used it for an in-program script editor with syntax colouring in the past to good effect.
Good luck!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
First off, you should use CScrollView, rather than CView.
Secondly, you need to either register a custom window class with a custom cursor and override the PreCreateWindow method (preferred), or handle WM_SETCURSOR messages and call SetCursor() with the proper cursor handle, previously loaded in your init code (will flicker).
onwards and upwards...
|
|
|
|
|