Click here to Skip to main content
16,018,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm trying to add a link to a static control, but I could not. Furthermore it does not appear in the area I want it to.

I want to remove a static control and recreate it with my own dimensions because it has a very small height and if the font size changes, some characters do not show.

Thanks.

What I have tried:

VB
first in HCBT_ACTIVATE
hFont=SendMessageA(hStatic,WM_GETFONT,0,0
GetClientRect hStatic,r
p.x=r.left : p.y=r.top
ScreenToClient wparam,p
DestroyWindow hStatic
MoveWindow hLink.......
SendMessageA hLink,WM_SETFONT,hFont,1

in HCBT_CREATEWND
hLink=CreateWindow(0,"SysLink",&H40000000+&H10000000,0,0,0,0,wparam,0&,0&)

'Msgbox raised without crashing but static area is blank
Posted
Updated 21-Jan-22 5:22am
v7

1 solution

Rather than use a simple message box for these extra features, the Task Dialog - Win32 apps | Microsoft Docs[^] offers far more flexibility for your purpose. This probably also applies to your other question on this subject.
 
Share this answer
 
Comments
[no name] 21-Jan-22 11:11am    
whats the problem of following code
Select Case uMsg
Case WM_NOTIFY
Dim nmh As NMHDR
CopyMemory nmh, ByVal lParam, Len(nmh)
Select Case lParam.uCode
Case NM_CLICK
Case NM_RETURN
Dim nml As NMLINK
CopyMemory nml,ByVal lParam,Len(nml)
If nml.hdr.hwndFrom=hLink And nml.item.ilink=0 Then
ShellExecute 0,"open",nml.item.szUrl,0,0,1
Elseif Instr(1,nml.item.szID,"idinfo")>0 Then
MessageBox wparam,"This is not much help","Example",MB_OK
End If
End Select
End Select
Richard MacCutchan 21-Jan-22 11:20am    
I do not know what is wrong with it. However, as I already suggested, it would be better to use controls that are designed to do what you want.
[no name] 4-Feb-22 11:25am    
because i set parametrs Of x,y,cx,cy in CreateWindowEx to Zero
Richard MacCutchan 4-Feb-22 12:00pm    
I have no idea what that is supposed to mean. And the main problem with this (and your other questions) is that you are not providing any context or real detail. A few lines of random code do not give anywhere near enough information to be able to help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900