荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标  题: [转载]  MSVC Digest - 16 Jan 1999 to 17 Jan 1999 (#1999-17)
发信站: BBS 荔园晨风站 (Mon Jan 18 17:36:37 1999), 站内信件

【 以下文字转载自 tang 的信箱 】
【 原文由 Automatic 所发表 】
There are 5 messages totalling 237 lines in this issue.

Topics of the day:

  1. Ugly Bitmap in Resource Editor
  2. using a scrollbar as a slider control (2)
  3. Hook in DLL. Simple problem?
  4. flicker free CHtmlView?

--------------------------------------------------------------------------
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

----------------------------------------------------------------------

Date:    Sun, 17 Jan 1999 16:57:39 +1100
From:    David Roe <dud@SYDNEY.NET>
Subject: Re: Ugly Bitmap in Resource Editor

you need to use a window class that is capable of displaying a bitmap in 256
colours. you could have a look at http://www.codeguru.com/bitmap/index.shtml
or I have some Win32 API C code I use for a splash-screen class that does
the job.

rgds,
/david

> -----Original Message-----
> From: Microsoft Visual C++ programmers list
> [mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of Darryl G. Wright
> Sent: Saturday, 16 January 1999 23:59
> To: MSVC@PEACH.EASE.LSOFT.COM
> Subject: Ugly Bitmap in Resource Editor
>
>
> I have a 256 colour bitmap with my company's logo on it that I
> want to drop
> onto the About dialog. I insert it into a new Bitmap in the
> resources and it
> looks great. I drop a static onto the about box and change it's properties
> to 'Bitmap' and set the ID to the same as my Bitmap...but it shows up
> butt-ugly with what looks like 16 colours or something - yech! Anyone know
> how to fix this?
>
> Thanks
>
> -=< Darryl >=-
>
> --------------------------------------------------------------------------
> The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription/signoff info
> and archives, see http://peach.ease.lsoft.com/archives/msvc.html .
>

------------------------------

Date:    Sun, 17 Jan 1999 17:00:49 +1100
From:    David Roe <dud@SYDNEY.NET>
Subject: Re: using a scrollbar as a slider control

i assume you'll have to respond to scrollbar messages sent to the parent
window (WM_VSCROLL, WM_HSCROLL). LOWORD(wParam) will contain one of the
following values: SB_TOP, SB_BOTTOM, SB_LINEUP, SB_LINEDOWN, SB_PAGEUP,
SB_PAGEDOWN, SB_THUMBPOSITION, SB_THUMBTRACK.

WM_HOPETHISHELPS,
/david

> -----Original Message-----
> From: Microsoft Visual C++ programmers list
> [mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of Rimu Atkinson
> Sent: Sunday, 17 January 1999 12:58
> To: MSVC@PEACH.EASE.LSOFT.COM
> Subject: using a scrollbar as a slider control
>
>
> vc++ 97, mfc
>
> I want to use a scrollbar in the place of a spin control (to change the
> value of an edit box) because of the extra functionality it could
> offer for
> adjustment over large ranges of values. However, I can't use the
> SpinCtrl::SetBuddy member function with a scroll bar, as scroll bars don't
> have any SetBuddy member function.
>
> has anyone dealt with this situation before, or can anyone see the way
> through here.
>
> cheers,
>
> Rimu Atkinson
> http://www.fortunecity.com/campus/economics/700/index.html
> ICQ # 26458113
>

------------------------------

Date:    Sat, 16 Jan 1999 19:08:42 +0800
From:    qiuliming <qiuliming@IHW.COM.CN>
Subject: Re: Hook in DLL. Simple problem?

Hi,
I am not sure, but I guess the problem is in the following line:
 hKeybHook = SetWindowsHookEx(WH_KEYBOARD, hKeybProc, m_hInstance, 0);
Is m_hInstance the hinstance of the application which uses your dll?

Hope this help!

Qiu Liming


----------
>
> Hello.
>
> Env: Windows NT 4.0 SP3, Visual C++ 6.0
>
> I'm new to this hook thing.
>
> I have created a DLL which contains a simple hook that captures all key
> presses and store them in a file. The DLL was created using AppWizard. I
> have export two functions from the DLL: InstallFilter and
> KeyboardProc.
>
> From a application I call the InstallFilter function. When debugging the DLL
> I can see that the InstallFilter is called but SetWindowsHookEx(...) returns
> NULL. When calling GetLastError() it returns 0. The
> Filter function never gets called.
>
> Here are some of the DLL code:
>
> /* Filter definition */
> LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam);
>
> /* Globals */
> HHOOK hKeybHook;
> HOOKPROC hKeybProc;
>
> /* DLL contructor */
> CHookDLLApp::CHookDLLApp()
> {
>  hKeybProc = (HOOKPROC)KeyboardProc;
> }
>
> /* Installer */
> int CHookDLLApp::InstallFilter(BOOL fInstall) {
>  if (fInstall) {
>   hKeybHook = SetWindowsHookEx(WH_KEYBOARD, hKeybProc, m_hInstance, 0);
>   if (hKeybHook == NULL) {
>    char szStr[15];
>    int error = GetLastError();
>    AfxMessageBox(itoa(error, szStr, 10));
>   }
>  }
>  else {
>   UnhookWindowsHookEx(hKeybHook);
>  }
>  return (0);
> }
>
> /* Filter function */
> LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {
>  char szOutputStr[255], szKeyCode[10];
>
>  szKeyCode[0] = (char)wParam;
>  szKeyCode[1] = 0;
>
>  strcpy(szOutputStr, "The user pressed: ");
>  strcat(szOutputStr, szKeyCode);
>  strcat(szOutputStr, "\r\n");
>
>  WriteDataToFile(szOutputStr);
>
>  return( CallNextHookEx(hKeybHook, code, wParam, lParam));
> }
>
> --------------------------------------------------------------------------
> The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription/signoff info
> and archives, see http://peach.ease.lsoft.com/archives/msvc.html .
>

------------------------------

Date:    Sun, 17 Jan 1999 07:23:51 -0500
From:    Srikanth C G <srikanth_cg@TRIGENT.COM>
Subject: Re: using a scrollbar as a slider control

I have another query on this same topic.

When a spin control is attached with and edit box, the keyboard up, down,
right and left keys can update the field.

This will happen when the EDIT CONTROL has the focus. We can get the same
effect when the scroll bar has focus. But I _DO NOT WANT_ tab stop for
scroll bar, still, I must be able to use the keyboard up, down, right, left
keys to update the edit control's value.

How to do this?

TIA,

Regards,
Srikanth C.G.

At 05:00 PM 1/17/99 +1100, you wrote:
>i assume you'll have to respond to scrollbar messages sent to the parent
>window (WM_VSCROLL, WM_HSCROLL). LOWORD(wParam) will contain one of the
>following values: SB_TOP, SB_BOTTOM, SB_LINEUP, SB_LINEDOWN, SB_PAGEUP,
>SB_PAGEDOWN, SB_THUMBPOSITION, SB_THUMBTRACK.
>
>WM_HOPETHISHELPS,
>/david
>

------------------------------

Date:    Sun, 17 Jan 1999 19:02:59 -0000
From:    Cliff Rowley <crowley@NOSPLASH.FORCE9.CO.UK>
Subject: flicker free CHtmlView?

OS:             Windows NT4/SP4
ENV:            MSVC++6/SP1

I have a class derived from CHtmlView, but it seems to flicker rather a =
lot when sizing.  I've tried overriding WM_ERASEBKGND, and it had no =
effect.

Could someone tell me how to prevent the flicker?  I have no input on =
the drawing side of things whatsoever.  The only thing my derived class =
does is contain a few helper functions.

Thanks.

Cliff Rowley.

------------------------------

End of MSVC Digest - 16 Jan 1999 to 17 Jan 1999 (#1999-17)
**********************************************************
--
※ 转载:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店