Private Type HLP
cbData As Integer
usCommand As Integer
ulTopic As Long
ulReserved As Long
offszHelpFile As Integer
offabData As Integer
szFilename As String * 256
End Type
Sub Main()
Shell "winhelp -x"
' WaitForInputIdle
Const Filename = "путь к файлу справки"
Dim h As HLP
h.cbData = 17 + Len(Filename)
h.usCommand = HELP_CONTEXTPOPUP
h.ulTopic = dwContextId
h.offszHelpFile = 16
h.szFilename = Filename & vbNullChar
SendMessage FindWindow("MS_WINHELP", vbNullString), &H38, 0, h 'недокументированное сообщение WM_WINHELP
End Sub
tyomitch писал(а):Он, правда, показывает текст на белом фоне вместо жёлтого, но перекрасить -- это пустяк
jangle писал(а):Можно еще UserControl использовать и выводить текст на его форме.
[3.1.10] Why can't I set the background color with the \cb help RTF statement?
Simple: It doesn't work. The \cb statement was never implemented by Microsoft. Ooops.
tyomitch
РичТекстБокс. Локед=тру, Апиаренс=Флэт, Бордер=0.
Private Sub RichTextBox1_GotFocus()
Command1.SetFocus
End Sub
Правильный MSDN писал(а):WM_PAINT
An application sends the WM_PAINT message when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by theDispatchMessage function when the application obtains a WM_PAINT message by using theGetMessage orPeekMessage function.
WM_PAINT
hdc = (HDC) wParam; // the device context to draw in
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 975
ClientLeft = 60
ClientTop = 450
ClientWidth = 6555
LinkTopic = "Form1"
ScaleHeight = 975
ScaleWidth = 6555
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text1
Height = 375
Left = 600
TabIndex = 1
Text = "Text1"
Top = 240
Width = 2415
End
Begin VB.PictureBox Picture1
Height = 375
Left = 3960
ScaleHeight = 315
ScaleWidth = 1995
TabIndex = 0
Top = 240
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_PAINT = &HF
Private Sub Text1_Change()
SendMessage Text1.hwnd, WM_PAINT, Picture1.hDC, 0&
End Sub
Хакер писал(а):Чтобы не быть голословным:Правильный MSDN писал(а):WM_PAINT
hdc = (HDC) wParam; // the device context to draw in
hdc = (HDC) wParam;
SetLayeredWindowAttributes
tyomitch писал(а):Хакер писал(а):Чтобы не быть голословным:Правильный MSDN писал(а):WM_PAINT
hdc = (HDC) wParam; // the device context to draw in
Откуда это хоть??
tyomitch писал(а):Для спрятанного текстбокса твой код не работает, только для видимого.
,WPARAM wParam, // not used
LPARAM lParam // not used
иThe WM_PAINT message is generated by the system and should not be sent by an application. To force a window to draw into a specific device context, use the WM_PRINT or WM_PRINTCLIENT message. Note that this requires the target window to support the WM_PRINTCLIENT message. Most common controls support the WM_PRINTCLIENT message.
For some common controls, the default WM_PAINT message processing checks the wParam parameter. If wParam is non-NULL, the control assumes that the value is an HDC and paints using that device context.
Хакер писал(а):А вот если спрятать листбокс за формой - всё прекрасно работает.
Сейчас этот форум просматривают: AhrefsBot, Google-бот, Yandex-бот и гости: 100