Click here to Skip to main content
15,905,233 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWndProc Within a class Pin
M.Mostafa3-Aug-03 1:16
M.Mostafa3-Aug-03 1:16 
GeneralRe: WndProc Within a class Pin
S O S3-Aug-03 3:15
S O S3-Aug-03 3:15 
GeneralRe: WndProc Within a class Pin
John R. Shaw3-Aug-03 10:05
John R. Shaw3-Aug-03 10:05 
Generalgetting files and directory. Pin
Anonymous3-Aug-03 0:40
Anonymous3-Aug-03 0:40 
GeneralRe: getting files and directory. Pin
HPSI3-Aug-03 0:54
HPSI3-Aug-03 0:54 
GeneralRe: getting files and directory. Pin
Bob Stanneveld3-Aug-03 7:49
Bob Stanneveld3-Aug-03 7:49 
Questionhow to get the other window's scrollbar handle ? Pin
yoyo2-Aug-03 23:22
yoyo2-Aug-03 23:22 
AnswerRe: how to get the other window's scrollbar handle ? Pin
HPSI3-Aug-03 1:25
HPSI3-Aug-03 1:25 
There are three issues here:

Issue #1: How to get the scrollbar HWND

Using a tool like HPS HwndSpy, you can examine the hierarchy of windows that Word uses. In the case of Word 2000 (Office XP), if you open Word with an empty document, you will see this hierarchy:

"Document1 - Microsoft Word"  class OpusApp
   ""  class _WwF
      "Document1" class _WwB
         ""  class ScrollBar
         ""  class ScrollBar

(The window titles are in quotes, followed by the window class name).

As you can see, there are two scrollbars, one vertical and one horizontal. It seems like the horizontal scrollbar is always second. So, to find the HWND of the horizontal scrollbar programmatically, simply traverse the window hierarchy for Word, until you come to class _WwB, and then grab the second ScrollBar.

Issue #2: It may not work like you expect

Some programs react violently when you try to send them messages. It may work, or it may not work, or it may cause Word to crash. So before you invest a lot of effort into this, you should first verify that it will work as you expect.

Issue #3: Different versions may be - well, different

You should verify that this technique will work on all the versions of Word that you are interested in. Different versions may have different window hierarchies, and may also react differently when you try to control the scrollbar.


HPS HwndSpy
- GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
GeneralRe: how to get the other window's scrollbar handle ? Pin
yoyo3-Aug-03 16:56
yoyo3-Aug-03 16:56 
Generalhey guys..new bie here Pin
virtualspy2-Aug-03 22:46
virtualspy2-Aug-03 22:46 
GeneralRe: hey guys..new bie here Pin
Rein Hillmann2-Aug-03 23:02
Rein Hillmann2-Aug-03 23:02 
GeneralRe: hey guys..new bie here Pin
virtualspy3-Aug-03 1:48
virtualspy3-Aug-03 1:48 
GeneralRe: hey guys..new bie here Pin
vcplusplus3-Aug-03 4:30
vcplusplus3-Aug-03 4:30 
GeneralRe: hey guys..new bie here Pin
Rein Hillmann3-Aug-03 7:17
Rein Hillmann3-Aug-03 7:17 
Generalchtmlview and disk drive questions Pin
pdunn2-Aug-03 18:39
pdunn2-Aug-03 18:39 
GeneralRe: chtmlview and disk drive questions Pin
Cathy2-Aug-03 23:23
Cathy2-Aug-03 23:23 
GeneralDVD Files / Burning Pin
Mike_V2-Aug-03 17:04
Mike_V2-Aug-03 17:04 
GeneralRe: DVD Files / Burning Pin
J. Dunlap2-Aug-03 19:22
J. Dunlap2-Aug-03 19:22 
GeneralRe: DVD Files / Burning Pin
Mike_V3-Aug-03 4:54
Mike_V3-Aug-03 4:54 
Questionhow to add tooltip for the CListctrl's Item? Pin
allenhu2-Aug-03 16:40
allenhu2-Aug-03 16:40 
AnswerRe: how to add tooltip for the CListctrl's Item? Pin
HPSI2-Aug-03 19:17
HPSI2-Aug-03 19:17 
Generalkeyboard constants Pin
Marissa1822-Aug-03 16:23
Marissa1822-Aug-03 16:23 
GeneralRe: keyboard constants Pin
PJ Arends2-Aug-03 18:28
professionalPJ Arends2-Aug-03 18:28 
Generalvectors. Pin
WREY2-Aug-03 10:46
WREY2-Aug-03 10:46 
GeneralRe: vectors. Pin
Christian Graus2-Aug-03 11:14
protectorChristian Graus2-Aug-03 11:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.