(Wobei mir Deine WinAPI schon sehr geholfen hat!)
SetZoom/GetZoom in Prozent, evtl. als Erweiterung zu dem Zoom-Eintrag in der WinAPI.
Code: Alles auswählen
Procedure.f Editor_GetZoomPct(Gadget)
  Protected wParam.l, hParam.l  , result.l
  result.l =  SendMessage_(GadgetID(Gadget),#EM_GETZOOM,@wParam, @hParam)
  
  If wParam=0 And hParam = 0   ; No Zoom
    ProcedureReturn 100
  EndIf
  
  ProcedureReturn (wParam/hParam *100)
EndProcedure 
Procedure Editor_SetZoomPct(Gadget,zoom.l)
  Protected result.l
  result.l =  SendMessage_(GadgetID(Gadget),#EM_SETZOOM,zoom,10)
EndProcedure 
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  EditorGadget(1,10,10,480,200,0)
  TrackBarGadget(2,10,220,480,20,1,100,0) 
  AddGadgetItem(1,-1,"Teststring",0,0)
  SetWindowTitle(0, "Window Zoom="+StrF(Editor_GetZoomPct(1),0)+"%")     
    
Repeat
EventID=WaitWindowEvent()
If EventID=#PB_Event_Gadget
  Select EventGadget()
   Case 2
     Editor_SetZoomPct(1, GetGadgetState(2))
     SetWindowTitle(0, "Window Zoom="+StrF(Editor_GetZoomPct(1),0)+"%")     
  EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
EndIf
Mike

