忍者ブログ

カウンター

プロモーション

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

AntinomyMy の実験室

   私のWEBアプリ実験室です!

ブログ内検索

楽天でお買い物

twitter

最新トラックバック

最新コメント

忍者アナライズ

ウェザーニュース

バーコード

本を買う

アクセス解析

Google+

[PR]

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。


No Image

Scroll Bar (スクロール バー) 日本語マニュアル を作る!

Window API 関連メモ

 さて、前回の説明の様にゴタゴタ思った訳なので、
Scroll Bar (スクロール バー) 日本語マニュアル っていうか
そのMSDN のサイトを日本語化しようと思います。
訳は英語知らない私が適当にします!


MSDN オフライン版(ダウンロードした物) のアドレス
ms-help://MS.MSDNQTR.v90.ja/shellcc/platform/commctls/scrollbars/scrollbars.htm
MSDN オンライン のアドレス
http://msdn.microsoft.com/ja-jp/library/bb787529(en-us,VS.85).aspx

Scroll Bar (スクロール バー)

This section contains information about the programming elements used with scroll bars.
(このセクションは、スクロールバー プログラミング の構成に関する情報を含んでいます。)
A window can display a data object, such as a document or a bitmap, that is larger than the window's client area.
(ウィンドウはデータや文書、またはビットマップなど、そのウィンドウのクライアント領域より大きいオブジェクトを表示することができます。)
 When provided with a scroll bar, the user can scroll a data object in the client area to bring into view the portions of the object that extend beyond the borders of the window.
(スクロール バー が提供されると、ユーザーはウインドウの境界線を越えた対象の部分を視界の中へ持って来るために、クライアント領域のデータ対象をスクロールすることができます。)

 

Overviews(概要)

About Scroll Bar (スクロールバーについて)

A scroll bar consists of a shaded shaft with an arrow button at each end and a scroll box (sometimes called a thumb) between the arrow buttons.

Using Scroll Bars (スクロールバーを使う)

When creating an overlapped, pop-up, or child window, you can add standard scroll bars by using the CreateWindowEx function and specifying WS_HSCROLL, WS_VSCROLL, or both styles.

 

 

Functions(関数)

EnableScrollBar

The EnableScrollBar function enables or disables one or both scroll bar arrows.

GetScrollBarInfo

The GetScrollBarInfo function retrieves information about the specified scroll bar.

GetScrollInfo

The GetScrollInfo function retrieves the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb).

GetScrollPos

The GetScrollPos function retrieves the current position of the scroll box (thumb) in the specified scroll bar. The current position is a relative value that depends on the current scrolling range. For example, if the scrolling range is 0 through 100 and the scroll box is in the middle of the bar, the current position is 50.

Note   The GetScrollPos function is provided for backward compatibility. New applications should use the GetScrollInfo function.
GetScrollRange

The GetScrollRange function retrieves the current minimum and maximum scroll box (thumb) positions for the specified scroll bar.

Note  The GetScrollRange function is provided for compatibility only. New applications should use the GetScrollInfo function.
ScrollDC

The ScrollDC function scrolls a rectangle of bits horizontally and vertically.

ScrollWindow

The ScrollWindow function scrolls the contents of the specified window's client area.

Note  The ScrollWindow function is provided for backward compatibility. New applications should use the ScrollWindowEx function.
ScrollWindowEx

The ScrollWindowEx function scrolls the contents of the specified window's client area.

SetScrollInfo

The SetScrollInfo function sets the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb). The function also redraws the scroll bar, if requested.

SetScrollPos

The SetScrollPos function sets the position of the scroll box (thumb) in the specified scroll bar and, if requested, redraws the scroll bar to reflect the new position of the scroll box.

Note  The SetScrollPos function is provided for backward compatibility. New applications should use the SetScrollInfo function.
SetScrollRange

The SetScrollRange function sets the minimum and maximum scroll box positions for the specified scroll bar.

Note  The SetScrollRange function is provided for backward compatibility. New applications should use the SetScrollInfo function.
ShowScrollBar

The ShowScrollBar function shows or hides the specified scroll bar.

 

 

Messages(メッセージ)

SBM_ENABLE_ARROWS

An application sends the SBM_ENABLE_ARROWS message to enable or disable one or both arrows of a scroll bar control.

SBM_GETPOS

The SBM_GETPOS message is sent to retrieve the current position of the scroll box of a scroll bar control. The current position is a relative value that depends on the current scrolling range. For example, if the scrolling range is 0 through 100 and the scroll box is in the middle of the bar, the current position is 50.

Applications should not send this message directly. Instead, they should use the GetScrollPos function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the GetScrollPos function to function properly.

SBM_GETRANGE

The SBM_GETRANGE message is sent to retrieve the minimum and maximum position values for the scroll bar control.

Applications should not send this message directly. Instead, they should use the GetScrollRange function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the GetScrollRange function to work properly.

SBM_GETSCROLLBARINFO

Sent by an application to retrieve information about the specified scroll bar.

SBM_GETSCROLLINFO

The SBM_GETSCROLLINFO message is sent to retrieve the parameters of a scroll bar.

Applications should not send this message directly. Instead, they should use the GetScrollInfo function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the GetScrollInfo function to work properly.

SBM_SETPOS

The SBM_SETPOS message is sent to set the position of the scroll box (thumb) and, if requested, redraw the scroll bar to reflect the new position of the scroll box.

Applications should not send this message directly. Instead, they should use the SetScrollPos function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the SetScrollPos function to work properly.

SBM_SETRANGE

The SBM_SETRANGE message is sent to set the minimum and maximum position values for the scroll bar control.

Applications should not send this message directly. Instead, they should use the SetScrollRange function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the SetScrollRange function to work properly.

SBM_SETRANGEREDRAW

An application sends the SBM_SETRANGEREDRAW message to a scroll bar control to set the minimum and maximum position values and to redraw the control.

SBM_SETSCROLLINFO

The SBM_SETSCROLLINFO message is sent to set the parameters of a scroll bar.

Applications should not send this message directly. Instead, they should use the SetScrollInfo function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the SetScrollInfo function to function properly.

 

 

Notifications(通知)

WM_CTLCOLORSCROLLBAR

The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.

A window receives this message through its WindowProc function.

WM_HSCROLL

The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.

A window receives this message through its WindowProc function.

WM_VSCROLL

The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.

A window receives this message through its WindowProc function.

 

 

Structures(構造体)

SCROLLBARINFO

The SCROLLBARINFO structure contains scroll bar information.

SCROLLINFO

The SCROLLINFO structure contains scroll bar parameters to be set by the SetScrollInfo function (or SBM_SETSCROLLINFO message), or retrieved by the GetScrollInfo function (or SBM_GETSCROLLINFO message).

 

 

Constants(定数)

Scroll Bar Control Styles

To create a scroll bar control using the CreateWindow or CreateWindowEx function specify the SCROLLBAR class, appropriate window style constants, and a combination of the following scroll bar control styles. Some of the styles create a scroll bar control that uses a default width or height. However, you must always specify the x- and y-coordinates and the other dimensions of the scroll bar when you call CreateWindow or CreateWindowEx.
 

拍手[0回]

PR

No Image

なんで! GetScrollBer 関数があるのに SetScrollBer関数 が無いんだっ!

Window API 関連メモ

 久しぶりに、ブログ書こうかと思ったのですが、
もう3~5年ほど解決してない問題があるんです・・・・・・・
 
 それはスクロールバーの見栄えの問題です。

スクロールバー を、スクロールバー をつける事が出来るウィンドウに対して
ウィンドウスタイルを指定してやれば、そのウィンドウに ※システムで定義された※ 幅の
スクロールバーを実装することが出来ます。

 またそれとは違って、スクロールバー 自体をウィンドウとして作る事ももちろん可能なんですが、
その場合は自身で決めた幅のスクロールバー が作れます。
 でもスクロールバー 自体をウィンドウとして作成すると、違うウィンドウでスクロールバーだけを
他のウィンドウの為に作ったりする事になり、なんだかイヤなんです。

 私は他のウィンドウに付いているスクロールバー の幅が変えたくて仕方がありません!!!

 私が知る所では、後からそのスクロールバーを太くしたり、細くする方法として
直接直感的に呼び出せる関数が無い気がするんです!

 多分これは、SCROLLBARINFO 構造体関係?では無いかと思っています。
SCROLLINFO 構造体 と SCROLLBARINFO 構造体は別物で、なぜかインターネット上には
SCROLLBARINFO 構造体の話はとても少ない。

 Windows API は他の人、自身ではない人が作った物が作ったので、作った人しか知らないルールがあり、
それ理解して使っている訳なんでしょうが、やっぱり見えない部分があります。

 やはり何度も何度も、この部分でつまづき、しかしどうしても他人が作った事だから知らなくていいや、
みたいな気持ちに悔しいですが成れなかったので、自身で解明するかぁ・・・ なんて事を思った訳なのです。

では何処から調べて行くか考えたのですが、
スクロールバー やスクロールバー コントロール に対して何かしようと
するならば、SendMessage や、
EnableScrollBar
GetScrollBarInfo
GetScrollInfo
GetScrollPos
GetScrollRange
ScrollDC
ScrollWindow
ScrollWindowEx
SetScrollInfo
SetScrollPos
SetScrollRange
ShowScrollBar

から色々出来るっぽいのですが・・・

これって、スクロールしたい内容についてばかりで、スクロールバーの太さとか、
thumb(親指と言う意味みたい、指の指紋?に煮てるけど、スクロール中央のマークかな?)とかの
デザインや、その辺の何かを取得して、設定する話があんまり技術文章で出てこない。
 あんまりっていうか全くかもしれないw

外国のサイトを調べていても、VC とか VC のサンプルで変えられるのはスクロールバー の色ぐらいで、
やっぱり始めにスクロールバー コントロールとして宣言している時意外は、後から
変更して見栄えを変えている気配がない・・・・

 多分その見栄えはきっと、SCROLLINFO 構造 (スクロール 量とかの情報)には無くて、
SCROLLBARINFO 構造 (スクロールバー の見栄え???)を持つ構造体を取得した後に、
部分的に変更してまたセット出来ればきっと?うまく行くハズ???なんて思っているんだけど
なんだかVB でこれまでやってきたのでうまく行かず、海外のサイトですら、ラッパーを作ってどうとか、
自前のメッセージ処理ルーチンを作っている始末;x;

 なんでMSDNって情報少ないんだ・・・・
他人に聞けば判るとか、質問サイトで質問すれば?みたいな対応なのだろうか?

 MSDNオンライン とか調べてて、大事な核心に限って英語のサイトであるなんていうのは
多くの人が経験している日本であるからの屈辱?っていうか、マイクロソフトの日本がどれだけ手抜きというか、
翻訳にお金を掛けて無いかって事なんだけろうけど、いい加減にしてくれ!wwwww
MSDN Library と Visual Studio が一体どれだけのバージョンを経たとしても何も変わっていない、
いくら.net とかになっても、最終的にAPI の存在を知らないと細かい事が出来ない事は、
多くの人が知っているのに、毎回手抜きで、しかもその実態(API)を見せない事こそ良い事の様に
他の方法を用いて使わせる事ばかり。
 方法を増やしても、結局覚える量が増えていくだけで、本当に細かく知る事が出来ない部分ばかり。

 外部の書籍などを頼らなくては細かく詳細をつかめない様な説明が多すぎるし、
いくらバージョンを上げても全く変わってない気がする。

 そんな事を考えたり、結局、他人(マイクロソフト)が作ったソフトウェアの上で
遊ばれているだけになってしまっている状況な時があるのはとても痛いが、
調べないのを続けていても満足しないので、翻訳ぐらいしてみようと思う。

 所詮人が作った物で、自身が作った物じゃないのを理解した上で・・・・
のつもりだが、みんなで使う共通のOSの意味では、やはり勝てないのも事実なのだろう。

 ちょっとココでも翻訳とかしてみて、悪足掻きしてみる。

Scroll Bar (スクロール バー) 日本語マニュアル を作る! に続く

拍手[0回]


No Image

ConvertINetMultiByteToUnicode

Window API 関連メモ

VB 6.0 でConvertINetMultiByteToUnicode の引数に65001 が使われていて、
意味不明だった為、VC のinclude フォルダを調べてみたメモ。

WINNLS.H にページコードの定数があった、
これがConvertINetMultiByteToUnicode の第2引数の様だ。
VB 6.0 は内部的にUNICODE で動いているのでUNICODE に直すのは普通なのかもしれないが、
文字コードは変数に格納する時に、文字列として格納するかとか、バイトの配列として格納するとか、
微妙に仕様言語や、ぷラットフォームが使っている文字エンコードの扱いによって違うので鵜呑みに出来ない、
その上ブラウザなどから得た情報は、ブラウザが文字種別を解釈してそれを渡しているのか、
それとも解釈せずに渡しているのかとかも考えた方がいい様だし、特に、
RegisterClipboardFormat とかのAPI を使うときはWindows の当たり前的な仕様も考えないと
いけない、なので今度はRegisterClipboardFormat のフォーマットの種類や、
ブラウザで用いられるOLE というかドラッグアンドドロップで操作出来る情報をを調べないといけないかな、
自身の都合上(かなり独り言)。

//
//  Code Page Default Values.
//
#define CP_ACP                    0           // default to ANSI code page
#define CP_OEMCP                  1           // default to OEM  code page
#define CP_MACCP                  2           // default to MAC  code page
#define CP_THREAD_ACP             3           // current thread's ANSI code page
#define CP_SYMBOL                 42          // SYMBOL translations

#define CP_UTF7                   65000       // UTF-7 translation
#define CP_UTF8                   65001       // UTF-8 translation


ついでに国も同じくWINNLS.H にあった。

//
//  Country Codes.
//
#define CTRY_DEFAULT              0

#define CTRY_ALBANIA              355         // Albania
#define CTRY_ALGERIA              213         // Algeria
#define CTRY_ARGENTINA            54          // Argentina
#define CTRY_AUSTRALIA            61          // Australia
#define CTRY_AUSTRIA              43          // Austria
#define CTRY_BAHRAIN              973         // Bahrain
#define CTRY_BELARUS              375         // Belarus
#define CTRY_BELGIUM              32          // Belgium
#define CTRY_BELIZE               501         // Belize
#define CTRY_BOLIVIA              591         // Bolivia
#define CTRY_BRAZIL               55          // Brazil
#define CTRY_BRUNEI_DARUSSALAM    673         // Brunei Darussalam
#define CTRY_BULGARIA             359         // Bulgaria
#define CTRY_CANADA               2           // Canada
#define CTRY_CARIBBEAN            1           // Caribbean
#define CTRY_CHILE                56          // Chile
#define CTRY_COLOMBIA             57          // Colombia
#define CTRY_COSTA_RICA           506         // Costa Rica
#define CTRY_CROATIA              385         // Croatia
#define CTRY_CZECH                420         // Czech Republic
#define CTRY_DENMARK              45          // Denmark
#define CTRY_DOMINICAN_REPUBLIC   1           // Dominican Republic
#define CTRY_ECUADOR              593         // Ecuador
#define CTRY_EGYPT                20          // Egypt
#define CTRY_EL_SALVADOR          503         // El Salvador
#define CTRY_ESTONIA              372         // Estonia
#define CTRY_FAEROE_ISLANDS       298         // Faeroe Islands
#define CTRY_FINLAND              358         // Finland
#define CTRY_FRANCE               33          // France
#define CTRY_GERMANY              49          // Germany
#define CTRY_GREECE               30          // Greece
#define CTRY_GUATEMALA            502         // Guatemala
#define CTRY_HONDURAS             504         // Honduras
#define CTRY_HONG_KONG            852         // Hong Kong
#define CTRY_HUNGARY              36          // Hungary
#define CTRY_ICELAND              354         // Iceland
#define CTRY_INDIA                91          // India
#define CTRY_INDONESIA            62          // Indonesia
#define CTRY_IRAN                 981         // Iran
#define CTRY_IRAQ                 964         // Iraq
#define CTRY_IRELAND              353         // Ireland
#define CTRY_ISRAEL               972         // Israel
#define CTRY_ITALY                39          // Italy
#define CTRY_JAMAICA              1           // Jamaica
#define CTRY_JAPAN                81          // Japan
#define CTRY_JORDAN               962         // Jordan
#define CTRY_KENYA                254         // Kenya
#define CTRY_KUWAIT               965         // Kuwait
#define CTRY_LATVIA               371         // Latvia
#define CTRY_LEBANON              961         // Lebanon
#define CTRY_LIBYA                218         // Libya
#define CTRY_LIECHTENSTEIN        41          // Liechtenstein
#define CTRY_LITHUANIA            370         // Lithuania
#define CTRY_LUXEMBOURG           352         // Luxembourg
#define CTRY_MACAU                853         // Macau
#define CTRY_MACEDONIA            389         // Republic of Macedonia
#define CTRY_MALAYSIA             60          // Malaysia
#define CTRY_MEXICO               52          // Mexico
#define CTRY_MONACO               33          // Principality of Monaco
#define CTRY_MOROCCO              212         // Morocco
#define CTRY_NETHERLANDS          31          // Netherlands
#define CTRY_NEW_ZEALAND          64          // New Zealand
#define CTRY_NICARAGUA            505         // Nicaragua
#define CTRY_NORWAY               47          // Norway
#define CTRY_OMAN                 968         // Oman
#define CTRY_PAKISTAN             92          // Islamic Republic of Pakistan
#define CTRY_PANAMA               507         // Panama
#define CTRY_PARAGUAY             595         // Paraguay
#define CTRY_PERU                 51          // Peru
#define CTRY_PHILIPPINES          63          // Republic of the Philippines
#define CTRY_POLAND               48          // Poland
#define CTRY_PORTUGAL             351         // Portugal
#define CTRY_PRCHINA              86          // People's Republic of China
#define CTRY_PUERTO_RICO          1           // Puerto Rico
#define CTRY_QATAR                974         // Qatar
#define CTRY_ROMANIA              40          // Romania
#define CTRY_RUSSIA               7           // Russia
#define CTRY_SAUDI_ARABIA         966         // Saudi Arabia
#define CTRY_SERBIA               381         // Serbia
#define CTRY_SINGAPORE            65          // Singapore
#define CTRY_SLOVAK               421         // Slovak Republic
#define CTRY_SLOVENIA             386         // Slovenia
#define CTRY_SOUTH_AFRICA         27          // South Africa
#define CTRY_SOUTH_KOREA          82          // South Korea
#define CTRY_SPAIN                34          // Spain
#define CTRY_SWEDEN               46          // Sweden
#define CTRY_SWITZERLAND          41          // Switzerland
#define CTRY_SYRIA                963         // Syria
#define CTRY_TAIWAN               886         // Taiwan Region
#define CTRY_THAILAND             66          // Thailand
#define CTRY_TRINIDAD_Y_TOBAGO    1           // Trinidad y Tobago
#define CTRY_TUNISIA              216         // Tunisia
#define CTRY_TURKEY               90          // Turkey
#define CTRY_UAE                  971         // U.A.E.
#define CTRY_UKRAINE              380         // Ukraine
#define CTRY_UNITED_KINGDOM       44          // United Kingdom
#define CTRY_UNITED_STATES        1           // United States
#define CTRY_URUGUAY              598         // Uruguay
#define CTRY_VENEZUELA            58          // Venezuela
#define CTRY_VIET_NAM             84          // Viet Nam
#define CTRY_YEMEN                967         // Yemen
#define CTRY_ZIMBABWE             263         // Zimbabwe

 

拍手[0回]


  • Home
[PR]