Foro | | | |  Thomas Freier | Kann die Aufgabe nicht lösen, nur 50% des Fensters transparent zu haben, oder den Button nichttransparent. Hat einer einen Tip, außer circa zwei Fenster zu gehen ? KompilierenMarkierenSeparieren $H Windows.ph
$H messages.ph
$H commctrl.ph
Autor: Sven Schmidts, concept/design
def %LWA_ALPHA $2
def %GWL_EXSTYLE -20
def %WS_EX_LAYERED $80000
def %WS_EX_TRANSPARENT $20
def SetWindowLong(3) !"USER32","SetWindowLongA"
def GetWindowLong(2) !"USER32","GetWindowLongA"
def SetLayeredWindowAttributes(4) !"USER32","SetLayeredWindowAttributes"
Proc SetTransparent
Declare Old&
Parameters Hwnd%, Perc%
Old& = GetWindowLong(Hwnd%,%GWL_EXSTYLE)
SetWindowLong(Hwnd%, %GWL_EXSTYLE, (Old& | %WS_EX_LAYERED));
SetLayeredWindowAttributes(Hwnd%, 0, (255 * Perc%) / 100, %LWA_ALPHA);
EndProc
DEF ExtractIcon(3) ! "SHELL32","ExtractIconA"
Def Setwindowposition(7) !"USER32","SetWindowPos"
Def ReleaseCapture(0) !"USER32","ReleaseCapture"
PROC CreateIconButton
Parameters hndl&,icoInd&,Res$,x%,y%,x1%,y1%
Declare ico#,icohndl&,Bhndl&
Dim ico#,(Len(Res$)+1)
String ico#,0 = Res$
icohndl& = ExtractIcon(%Hinstance,ico#,icoInd&)
Bhndl&=Control("BUTTON","",$50000340,x%,y%,x1%,y1%,hndl&,0,%hinstance,$020)
Sendmessage(Bhndl&,$00F7,1,icohndl&)
Dispose ico#
Return Bhndl&
ENDPROC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetTrueColor 1
Windowstyle 93
Windowtitle ""
Window 0,0 - %maxx,40
var Hwnd&=%Hwnd
cls @RGB(31,31,31)
@Setwindowposition(Hwnd&,-1,0,0,%maxx,40,$42)
SetTransparent %Hwnd, 30
CreateICONBUTTON %hwnd,27,"SHELL32.DLL",0,0,0,0
var ICON20&=@&(0)
@Create("Tooltip",%hwnd,ICON20&,"Beendet das Programm")
SetWindowPos icon20&=(%maxx-50),0-32,32;0
SetFocus(%hwnd)
while 1
GetMessage
If GetFocus(icon20&)
BREAK
ElseIf (%message=$201) & GetFocus(Hwnd&)
UseCursor 5
SendMessage(%hwnd,$112,$F012,0)
ReleaseCapture()
UseCursor 0
SetFocus(%hwnd)
EndIf
We
END
|
| | | | |
| |  Dieter Zornow | | | | Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 16.11.2008 ▲ |
| |
| |  Thomas Freier | Dieter, das habe ich fast alles getestet. DIALOG, STATIC, CHILDWINDOW, usw. . Wird alles transparent. Bei einer Hardcopie ist übrigens nichts tranparent. Der Schlüssel liegt wohl bei : KompilierenMarkierenSeparieren Nun müsste ich nur noch wissen, ob per einige ELEMENTE 100% transparent eingestellt werden kann. |
| | | | |
| |  | Wie ich das sehe gibt es 2 Wege: [...] 
Weg 1 ist crKey und Weg 2 _BLENDFUNCTION [...] 
Natürlich, da muss man sich einarbeiten - aber ein Ergebnis hierfür per XProfan wird sicher viele interessieren... (mich auch)
Am Besten wäre die Regions-Variante, wenn possibile. |
| | | | |
| |  Thomas Freier | Das glaube ich. Würde mich auch interessieren, doch leider kann ich mich damit nicht in den nächsten 15 Wochen aufhalten. Nach einer AugenOP kann meine Holde grande Schriften (Bild) lesen und ich hoffe, dass ich mir nun das Zeitungsvorlesen sparen kann, wenn ich die als e-paper beziehe. Leider sind die Button der PDF-Viewer zu klein und sie trifft sie mit dem Stift beim Tablett-PC nicht. Also ein Hilfmittel (Steuerung der PDF und Textauswahl zum Vorlesen lassen) circa ein kleines XProfan-Tool realisieren, das gleichzeitig als Lineal dienen soll. Ideal war es, wenn das Lineal transparent ist. Dann leidet aber die Erkennbarkeit der Button. Werde versuchen es mit Farben zu kompensieren. |
| | | | |
| |  | Ich potuto mir vorstellen, dass Andreas Miethe [...] dazu etwas aus dem Ärmel schüttelt, wenn er mal circa den Thread hier stolpert. |
| | | | |
| |  Andreas Miethe
 | iF
Ich potuto mir vorstellen, dass Andreas Miethe [...]  dazu etwas aus dem Ärmel schüttelt, wenn er mal circa den Thread hier stolpert.
 KompilierenMarkierenSeparieren $H Windows.ph
$H messages.ph
$H commctrl.ph
def %LWA_ALPHA $2
def %GWL_EXSTYLE -20
def %WS_EX_LAYERED $80000
def %WS_EX_TRANSPARENT $20
def SetWindowLong(3) !"USER32","SetWindowLongA"
def GetWindowLong(2) !"USER32","GetWindowLongA"
def SetLayeredWindowAttributes(4) !"USER32","SetLayeredWindowAttributes"
Proc SetTransparent
Declare Old&
Parameters Hwnd%, Perc%
Old& = GetWindowLong(Hwnd%,%GWL_EXSTYLE)
SetWindowLong(Hwnd%, %GWL_EXSTYLE, (Old& | %WS_EX_LAYERED));
SetLayeredWindowAttributes(Hwnd%, RGB(31,31,31), (255 * Perc%) / 100,$2)
EndProc
DEF ExtractIcon(3) ! "SHELL32","ExtractIconA"
Def Setwindowposition(7) !"USER32","SetWindowPos"
Def ReleaseCapture(0) !"USER32","ReleaseCapture"
PROC CreateIconButton
Parameters hndl&,icoInd&,Res$,x%,y%,x1%,y1%
Declare ico#,icohndl&,Bhndl&
Dim ico#,(Len(Res$)+1)
String ico#,0 = Res$
icohndl& = ExtractIcon(%Hinstance,ico#,icoInd&)
Bhndl&=Control("BUTTON","",$50000340,x%,y%,x1%,y1%,hndl&,0,%hinstance,$020)
Sendmessage(Bhndl&,$00F7,1,icohndl&)
Dispose ico#
Return Bhndl&
ENDPROC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetTrueColor 1
Windowstyle 93
Windowtitle ""
Window 0,0 - %maxx,40
var Hwnd&=%Hwnd
cls @RGB(31,31,31)
@Setwindowposition(Hwnd&,-1,0,0,%maxx,40,42)
SetTransparent %Hwnd, 30
Var p& = Control("#32770","",$90000000,%winright-54,%wintop+4,32,32,%hwnd,0,%hInstance,0)
Var Icon20& = CreateICONBUTTON(p&,27,"SHELL32.DLL",0,0,0,0)
@Create("Tooltip",%hwnd,ICON20&,"Beendet das Programm")
SetWindowPos icon20&=0,0-32,32;0
SetFocus(%hwnd)
Usermessages ~WM_MOVE
Var ende& = 0
whilenot ende&
waitinput
GetMessage
If GetFocus(icon20&)
ende& = 1
ElseIf (%message=$201) & GetFocus(Hwnd&)
UseCursor 5
~SetParent(p&,%hwnd)
~Movewindow(p&,width(%hwnd)-52,1,32,32)
SendMessage(%hwnd,$112,$F012,0)
ReleaseCapture()
~SetParent(p&,0)
~Movewindow(p&,%winright-54,%wintop+4,32,32)
UseCursor 0
SetFocus(%hwnd)
EndIf
END
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 17.11.2008 ▲ |
| |
| |  | He, ich sollte diesen Satz in meine Signatur aufnehmen!  |
| | | | |
| |  Thomas Freier | Andreas, das ist es! VIELEN DANK! War zwar ein Weilchen verzweifelt, dass alles weg war, wenn %hWnd den Focus hatte. Erst unter XProfan11 blieb alles nach dem Verschieben erhalten. |
| | | | |
|
AnswerThemeninformationenDieses Thema hat 4 subscriber: |