Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 01:44

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Eine Form schön skinnen

Discussion on Eine Form schön skinnen within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2006
Posts: 222
Received Thanks: 3
Hiho

Wer sein proggy evtl mal nen besseren look verpassen will, kann das in diesem kleinen tut lernen.

Ich werde es hier mit VB6 und Windows XP(und höher) zeigenm, da windoof da gleich ne feine API für hat... Es geht auch i Win9x aber etwas langsamer und komplizierter.

Grundlage für all das soll ein Modul sein... Nenne wirs modSkin.bas
Code:
Public Declare Function SetLayeredWindowAttributes Lib "USER32" (ByVal hwnd As stdole.OLE_HANDLE, ByVal crKey As stdole.OLE_COLOR, ByVal bAlpha As Byte, ByVal dwFlags As LAYERED_WINDOW_ATTRIB) As Long
Public Declare Function GetWindowLongPtr Lib "USER32" Alias "GetWindowLongA" (ByVal hwnd As stdole.OLE_HANDLE, ByVal nIndex As WINDOW_OFFSETS) As Long
Public Declare Function SetWindowLongPtr Lib "USER32" Alias "SetWindowLongA" (ByVal hwnd As stdole.OLE_HANDLE, ByVal nIndex As WINDOW_OFFSETS, ByVal dwNewLong As Long) As Long

Public Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Public Declare Function ReleaseCapture Lib "USER32" () As Long
Public Declare Function SetWindowPos Lib "USER32" (ByVal hwnd As stdole.OLE_HANDLE, ByVal hwndInsertAfter As ZORDER, ByVal X As stdole.OLE_XPOS_PIXELS, ByVal Y As stdole.OLE_YPOS_PIXELS, ByVal cx As stdole.OLE_XSIZE_PIXELS, ByVal cy As stdole.OLE_YSIZE_PIXELS, ByVal uFlags As WINDOWPOSFLAGS) As Long

Public Enum LAYERED_WINDOW_ATTRIB
  LWA_COLORKEY = &H1&
  LWA_ALPHA = &H2&
End Enum

Public Enum ZORDER
 HWND_TOP = (0)     ' /* Places the window at the top of the Z order. */
 HWND_BOTTOM = (1)   ' /* Places the window at the bottom of the Z order. If the hWnd parameter
             ' * identifies a topmost window, the window loses its topmost status and is
             ' * placed at the bottom of all other windows.
             ' */
 HWND_TOPMOST = (-1)  ' /* Places the window above all non-topmost windows. The window maintains
             ' * its topmost position even when it is deactivated.
             ' */
 HWND_NOTOPMOST = (-2) ' /* Places the window above all non-topmost windows (that is, behind all
             ' * topmost windows). This flag has no effect if the window is already a
             ' * non-topmost window.
             ' */
End Enum


Public Enum WINDOW_OFFSETS
 GWL_EXSTYLE = (-20)       ' Sets a new extended window style. For more information, see CreateWindowEx.
 GWL_STYLE = (-16)        ' Sets a new window style.
 GWL_WNDPROC = (-4)       ' Sets a new address for the window procedure.
 GWL_HINSTANCE = (-6)      ' Sets a new application instance handle.
 GWL_ID = (-12)         ' Sets a new identifier of the window.
 GWL_USERDATA = (-21)      ' Sets the user data associated with the window. This data is intended for use by the application that created the window.
                 ' Its value is initially zero.
 Rem The following values are also available when the hWnd parameter identifies a dialog box.
 DWL_DLGPROC = 4         ' Sets the new pointer to the dialog box procedure.
 DWL_MSGRESULT = 0        ' Sets the return value of a message processed in the dialog box procedure.
 DWL_USER = 8          ' Sets new extra information that is private to the application, such as handles or pointers.
End Enum

Public Enum WINDOW_STYLE_EXTENDED
 WS_EX_DLGMODALFRAME = &H1&    ' Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.
 WS_EX_NOPARENTNOTIFY = &H4&   ' Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.
 WS_EX_TOPMOST = &H8&       ' Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated.
                  ' To add or remove this style, use the SetWindowPos function.
 WS_EX_ACCEPTFILES = &H10&    ' Specifies that a window created with this style accepts drag-drop files.
 WS_EX_TRANSPARENT = &H20&    ' Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted.
                  ' The window appears transparent because the bits of underlying sibling windows have already been painted. To achieve transparency without these restrictions, use
                  ' the SetWindowRgn function.

 WS_EX_LAYERED = &H80000     ' Creates a layered window. Layered windows supported translucency effects.
#If (WIN32_IE >= &H400) Then
 WS_EX_MDICHILD = &H40&      ' Creates an MDI child window.
 WS_EX_TOOLWINDOW = &H80&     ' Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the
                  ' window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window
                  ' has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.
 WS_EX_WINDOWEDGE = &H100&    ' Specifies that a window has a border with a raised edge.
 WS_EX_CLIENTEDGE = &H200&    ' Specifies that a window has a border with a sunken edge.
 WS_EX_CONTEXTHELP = &H400&    ' Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then
                  ' clicks a child window, the child receives a WM_HELP message.

 WS_EX_RIGHT = &H1000&      ' The window has generic ?gright-aligned?h properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic,
                  ' or another language that supports reading-order alignment; otherwise, the style is ignored.
 WS_EX_LEFT = &H0&        ' Creates a window that has generic left-aligned properties. This is the default.
 WS_EX_RTLREADING = &H2000&    ' If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order
                  ' properties. For other languages, the style is ignored.
 WS_EX_LTRREADING = &H0&     ' The window text is displayed using left-to-right reading-order properties. This is the default.
 WS_EX_LEFTSCROLLBAR = &H4000&  ' If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the
                  ' client area. For other languages, the style is ignored.
 WS_EX_RIGHTSCROLLBAR = &H0&   ' Vertical scroll bar (if present) is to the right of the client area. This is the default.

 WS_EX_CONTROLPARENT = &H10000  ' Allows the user to navigate among the child windows of the window by using the TAB key.
 WS_EX_STATICEDGE = &H20000    ' Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
 WS_EX_APPWINDOW = &H40000    ' Forces a top-level window onto the taskbar when the window is visible.

 WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE ' Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
 WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST ' Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.
 
 
#End If
End Enum

Public Enum WINDOWPOSFLAGS
  SWP_NOSIZE = &H1       ' /* Retains current size (ignores the cx and cy members). */
  SWP_NOMOVE = &H2       ' /* Retains current position (ignores the x and y members). */
  SWP_NOZORDER = &H4      ' /* Retains current ordering (ignores the hwndInsertAfter member). */
  SWP_NOREDRAW = &H8      ' /* Does not redraw changes. */
  SWP_NOACTIVATE = &H10    ' /* Does not activate the window. */
  SWP_FRAMECHANGED = &H20   ' /* The frame changed: send WM_NCCALCSIZE */
  SWP_SHOWWINDOW = &H40    ' /* Displays the window. */
  SWP_HIDEWINDOW = &H80    ' /* Hides the window. */
  SWP_NOCOPYBITS = &H100    ' /* Discards the entire contents of the client area. If this flag
                 ' * is not specified, the valid contents of the client area are
                 ' * saved and copied back into the client area after the window is
                 ' * sized or repositioned.
                 ' */
  SWP_NOOWNERZORDER = &H200  ' /* Don't do owner Z ordering */
  SWP_NOSENDCHANGING = &H400  ' /* Don't send WM_WINDOWPOSCHANGING */

  SWP_DRAWFRAME = SWP_FRAMECHANGED ' /* Draws a frame (defined in the class description for the
                  ' * window) around the window. The window receives a WM_NCCALCSIZE
                  ' * message.
                  ' */
  SWP_NOREPOSITION = SWP_NOOWNERZORDER

  #If (WIN32_IE >= &H400) Then
    SWP_DEFERERASE = &H2000   ' /* Prevents generation of the WM_SYNCPAINT message. */
    SWP_ASYNCWINDOWPOS = &H4000 ' /* If the calling thread and the thread that owns the window are
                   ' * attached to different input queues, the system posts the
                   ' * request to the thread that owns the window. This prevents the
                   ' * calling thread from blocking its execution while other threads
                   ' * process the request.
                   ' */
  #End If ' /* WINVER >= =0x0400 */
End Enum

Const WM_NCLBUTTONDOWN = &HA1

Public Function LayerWindow(pHandle As stdole.OLE_HANDLE) As Boolean
  Dim prevStyle As Long
  Dim isLayered As Boolean
  Let prevStyle = &H0&
  
  On Error GoTo err_error
  'Get the original window style.
  Let prevStyle = GetWindowLongPtr(pHandle, GWL_EXSTYLE)
  'Make the window a layered window if it is not layered.
  Let isLayered = ((prevStyle And WINDOW_STYLE_EXTENDED.WS_EX_LAYERED) = WINDOW_STYLE_EXTENDED.WS_EX_LAYERED)
  
  If Not isLayered Then
    'Window isn't layerd so layer it
    Call SetWindowLongPtr(pHandle, GWL_EXSTYLE, (prevStyle Or WINDOW_STYLE_EXTENDED.WS_EX_LAYERED))
  End If
  
  'Now we have to set the window full viewable
  LayerWindow = True
  
err_error:
  Exit Function
End Function

Public Function SetTranslucency(pHandle As stdole.OLE_HANDLE, pValue As Byte) As Boolean
  On Error GoTo err_error
  Call LayerWindow(pHandle)
  Call SetLayeredWindowAttributes(pHandle, ByVal 0&, pValue, LWA_ALPHA)
  
  SetTranslucency = True
err_error:
  Exit Function
End Function

Public Function SetTransparent(pHandle As stdole.OLE_HANDLE, pColor As stdole.OLE_HANDLE) As Boolean
  On Error GoTo err_error
  Call LayerWindow(pHandle)
  Call SetLayeredWindowAttributes(pHandle, ByVal pColor, ByVal 0&, LWA_COLORKEY)
  
  SetTransparent = True
  
err_error:
  Exit Function
End Function

Public Function Combine(pHandle As stdole.OLE_HANDLE, pColor As stdole.OLE_COLOR, pTrans As Byte)
On Error GoTo err_error
  Call LayerWindow(pHandle)
  Call SetLayeredWindowAttributes(pHandle, ByVal pColor, pTrans, LWA_ALPHA Or LWA_COLORKEY)
  
err_error:
  Exit Function
End Function

'Function does the same like the titelbar from window
Public Sub MoveWindowEx(pHandle As stdole.OLE_HANDLE)
  ReleaseCapture
  Call SendMessage(pHandle, WM_NCLBUTTONDOWN, 2&, 0&)
End Sub





Sooooo nun stehen uns 3 Lustige Sachen zur verfügung....
1. Ein Fenster Durchsichtig machen
2. Eine bestimmte Fensterfarbe durchsichtig machen
3. Das Fesnter ohne Titelleiste bewegen

Ich hab euch mal nen Demoprojekt gemacht schauts euch an und seid glücklich^^



Das ganze ist nicht vorcompiled nur der source halt
r00kie is offline  
Reply


Similar Threads Similar Threads
Mods schön und gut aber wohin?
08/25/2010 - WarRock - 3 Replies
closerequest hab PN bekommen=) danke
Bitte Schön Hack schon Fertig :)))
07/12/2010 - Combat Arms Hacks, Bots, Cheats & Exploits - 87 Replies
Das ist der Hack wofür ihr THX gedrückt habt VIEL SPAß damit!(FRAGT MICH NICHT NACH PW!) Also habe mit nem Freund den Hack HEUTE schon fertig bekommen! Dank seiner großen Hilfe er nahm sich heute extra mehrere Stunden Zeit. Features: NX Chaims+Box No Recoil (Funktioniert) No Spread (Funktioniert) Speed ist auf 1 (Von einer Stuffe 0-20 ausgesucht) Ihr könnt Waffen aufheben von überall (Bsp. Kill Creek ihr Tötet einen auf der anderen Seite und könnt ihm die Waffe nehmen egal wie weit...
deskophintergrund sehr schön!!!
06/28/2010 - CrossFire - 24 Replies
ich habe ein paar schöne deskop hintergründe gefunden von einer wirklich guten SPOP wer sie haben will ist unten im anhang achja und ihr brauch mit kein THX geben wäre aber nett;)
habe eine frage zu einer login form
04/01/2010 - AutoIt - 2 Replies
hey brauche hilfe will das wenn man die richtigen daten angibt das sich dann eine mdgbox öffnet aber es klappt nicht pls helft mir thx ich weiß da klappt vieles noch nicht pls helft mir bei der else und mit der func _login pls helft mir #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Login SVZ Designer by Chriss ", 465, 166, 268, 238) GUISetBkColor(0xA6CAF0)
Schön?
04/29/2005 - Off Topic - 26 Replies
wollte ich nur einmal gesagt haben....... :p



All times are GMT +1. The time now is 01:44.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.