|
Hi All !
Like in the old driver installation apps , I'd like to insert or remove a REM in a dos batch file, i.e. to insert/remove a string in the middle of a file.
What is the best way to do it ?
~RaGE();
|
|
|
|
|
Just read all lines of the file in a memory, like in a list of CString s. Then parse every line and add the REM or remove it.
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
OK, that's what I was doing up to now, but I thought there was a way to do it directly in the file.
Thank you very much for your help.
~RaGE();
|
|
|
|
|
Is it possible to modify the Exports Tables from PE files? How?
VikramS
|
|
|
|
|
OBS!<br />
No MFC sh*t now! Okay? :)
How can I keep the background color white when I have a read-only edit box?
I do my painting with SetBkColor() in WM_CTLCOLOREDIT.
But that may be wrong? Or...
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
You should probably have to derivate your own class from CEdit, and try to catch the reflection of WM_CTLCOLOR (ON_WM_CTLCOLOR_REFLECT() ), then implement HBRUSH CMyEdit::CtlColor(CDC* pDC, UINT nCtlColor)
HTH,
K.
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
KaЯl wrote:
CEdit
But KaЯl, what did I said in the beginning of my message?
"No MFC sh*t now"
Do you know how to cath the reflection in pure Win32?
Thank you anyway!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
, my apologizes, I wasn't careful enough.
In MFC sources:
#define ON_WM_CTLCOLOR_REFLECT() \<br />
{ WM_CTLCOLOR+WM_REFLECT_BASE, 0, 0, 0, AfxSig_hDw, \<br />
(AFX_PMSG)(AFX_PMSGW)(HBRUSH (AFX_MSG_CALL CWnd::*)(CDC*, UINT))CtlColor },
I have really few experience of pure Win32 programming, it is possible to catch in your message loop the one corresponding to (WM_CTLCOLOR+WM_REFLECT_BASE), for the window with
the HWND of the Edit control ?
Perhaps this page [^] may help you.
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
Intercept WM_CTLCOLORSTATIC in the window procedure of the control's parent.
rechi
|
|
|
|
|
Woohoo!
Danke schön!
BUT!
The whole edit box doesn't get white!
My edit is 300 in height and if I have not put text on all lines there will be grey color on lines where I don't have text. Daoh... it's difficult to explain... my egnlish just went broken!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Call
SetBkColor((HDC)wParam, BACKGROUND_COLOR); before returning from the handler of WM_CTLCOLORSTATIC .
rechi
|
|
|
|
|
Bogdan Rechi wrote:
before returning from the handler of WM_CTLCOLORSTATIC
Huh?
What do you mean?
I do like this:
....
case WM_CTLCOLORSTATIC:
if((HWND)lParam == myEdit)
SetBkColor((HDC)wParam, RGB(255,255,255));
break;
....
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Do it like this:
case WM_CTLCOLORSTATIC:
if((HWND)lParam == myEdit)
{
SetBkColor((HDC)wParam, RGB(255,255,255));
return (BOOL)GetStockObject(WHITE_BRUSH);
}
rechi
|
|
|
|
|
Hello, hope you can see this!
I did like you said, it is painting the whle edit white now, BUT!
When I put 10 lines with text and then put 1 line text to the edit box, the old text is still there!
The text is in the "DC" I think, because when I move the window outside the screen, it will remove the text. Hope you understand!
Do you know how to fix that? I've tried UpdateWindow() and InvalidateRect() but they don't work!
Thank you!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
hi
does anybody know how to create a 24-bpp bitmap on the fly (ie not from a resource, or by loading), change a pixel in it, and then output it to a dialog box?
thanx,
paul.
|
|
|
|
|
sntpaul wrote:
does anybody know how to create a 24-bpp bitmap on the fly
Yes. CreateBitmap.
change a pixel in it
SetPixel
and then output it to a dialog box?
BitBlt
You might also want to read up on some of the large amount of samples provided by e.g. MSDN.
|
|
|
|
|
hello all,
i try to disable scrollbar in HtmlView.
i know i must work with IDocHostUIHandler::GetHostInfo();
and put the flag DOCHOSTUIFLAG_SCROLL_NO.
but i don't understand how implement this
you know how to do this?
PS : i work with VC7.
|
|
|
|
|
VC7 makes your life easy! You only need to implement the new invented function OnGetHostInfo(DOCHOSTUIINFO *pInfo ).
F.i:
HRESULT MyView::OnGetHostInfo(
DOCHOSTUIINFO *pInfo )
{
pInfo->cbSize = sizeof(DOCHOSTUIINFO);
pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO;
return S_OK;
}
|
|
|
|
|
THX for your answer!!
yes with vc7 it seems easy
but what is the command in message map ?
|
|
|
|
|
jeremysay wrote:
but what is the command in message map ?
No entry in the message map required - it's a virtual function
|
|
|
|
|
Thx again Schlaubi!!
it's works perfectly !
but i can't decide when i want to show scrollbar or not.
its a problem for me...
|
|
|
|
|
sorry i have another question
you knwo how get the scrollabr position (always for htmlview)?
i can set a position to scrollbars
IDispatch *pDisp = GetHtmlDocument();
IHTMLDocument2 *pDocument = NULL;
pDisp->QueryInterface( IID_IHTMLDocument2, ( void** )&pDocument );
IHTMLElement* pBody = NULL;
pDocument->get_body( &pBody );
IHTMLWindow2* pWindow = NULL;
pDocument->get_parentWindow( &pWindow );
pWindow->scroll( 250, 300 );
but i don't know how get the position
|
|
|
|
|
When possessing a pointer to the body element (and you already have one), you could try calling IHTMLElement's offsetTop function. It should return the body's offset from the top of the page, and I hope that's what you're looking for
|
|
|
|
|
I think it's not exactly what i need.
when i resize window i want to scroll exactly where it is before resizing.
that's why i need to know the position of scrollbars.
You think with offsetTop,offsetLeft... i can do this ?
|
|
|
|
|
there is no problem i find how to do.
i want to thank you Schlaubi for your help !!
|
|
|
|