通过delphi写的程序,能否替换或改变其他软件界面的图片?

解决方案 »

  1.   

    可以
    只要你找得到它的图片的Handle
    没做过
      

  2.   

    答案是:可以。
    好消息是:只要是windows API提供的功能,我们就可以调用,windows API没有提供的功能,有一些我们可以手动。而楼主所说的这些,都在windows API提供之列。
      

  3.   

    多谢楼上,能否给点资料或代码,我已经查过API了,或许是我的能力有问题,没有发现你所说的那些。
      

  4.   

    难啊。图片如果是用image加载的,不好找。它没有句柄...
      

  5.   

    查一下关于窗口操作的API吧。
    Function
    DescriptionAdjustWindowRect
    Calculates the required size of the window rectangle, based on the desired client-rectangle size. 
    AdjustWindowRectEx
    Calculates the required size of the window rectangle, based on the desired client-rectangle size. 
    AllowSetForegroundWindow
    Enables a process to set the foreground window using the SetForegroundWindow function. 
    AnimateWindow
    Enables you to produce special effects when showing or hiding windows.
    ArrangeIconicWindows
    Arranges all minimized (iconic) child windows of the specified parent window. 
    BeginDeferWindowPos
    Allocates memory for a multiple-window- position structure and returns the handle to the structure.
    BringWindowToTop
    Brings the specified window to the top of the Z order. 
    CascadeWindows
    Cascades the specified child windows of the specified parent window.
    ChildWindowFromPoint
    Determines which, if any, of the child windows belonging to a parent window contains the specified point. 
    ChildWindowFromPointEx
    Determines which, if any, of the child windows belonging to a parent window contains the specified point. 
    CloseWindow
    Minimizes (but does not destroy) the specified window. 
    CreateWindow
    Creates an overlapped, pop-up, or child window.
    CreateWindowEx
    Creates an overlapped, pop-up, or child window with an extended window style.
    DeferWindowPos
    Updates the specified multiple-window - position structure for the specified window. 
    DestroyWindow
    Destroys the specified window.
    EndDeferWindowPos
    Updates the position and size of one or more windows. 
    EnumChildProc
    An application-defined callback function used with EnumChildWindows.
    EnumChildWindows
    Enumerates the child windows that belong to the specified parent window
    EnumClaw
    Returns the child or last ancestor window of the HWND that is passed in.
    EnumThreadWindows
    Enumerates all nonchild windows associated with a thread.
    EnumThreadWndProc
    An application-defined callback function used with EnumThreadWindows.
    EnumWindows
    Enumerates all top-level windows on the screen. 
    EnumWindowsProc
    An application-defined callback function used with EnumWindows or EnumDesktopWindows. 
    FindWindow
    Retrieves a handle to the top-level window whose class name and window name match the specified strings. 
    FindWindowEx
    Retrieves a handle to the top-level window whose class name and window name match the specified strings. 
    GetAltTabInfo
    Retrieves status information for the application-switching (ALT+TAB) window.
    GetAncestor
    Retrieves the handle to the ancestor of the specified window. 
    GetClientRect
    Retrieves the coordinates of a window's client area. 
    GetDesktopWindow
    Returns a handle to the desktop window. 
    GetForegroundWindow
    Returns a handle to the foreground window. 
    GetGUIThreadInfo
    Retrieves information about the active window or a GUI thread.
    GetLastActivePopup
    Determines which pop-up window was most recently active. 
    GetLayeredWindowAttributes
    Retrieves the opacity and transparency color key of a layered window.
    GetLayout
    Returns the layout of a device context.
    GetNextWindow
    Retrieves a handle to the next or previous window in Z order. 
    GetParent
    Retrieves a handle to the specified child window's parent window. 
    GetProcessDefaultLayout
    Gets the default layout used for windows with no parent or owner.
    GetTitleBarInfo
    Retrieves information about the specified title bar.
    GetTopWindow
    Retrieves a handle to the child window at the top of the Z order. 
    GetWindow
    Retrieves a handle to a window that has the specified relationship to the specified window.
    GetWindowInfo
    Retrieves information about the specified window.
    GetWindowModuleFileName
    Retrieves the full path and file name of the module associated with the specified window handle. 
    GetWindowPlacement
    Retrieves the show state and the restored, minimized, and maximized positions of the specified window. 
    GetWindowRect
    Retrieves the dimensions of the bounding rectangle of the specified window.
    GetWindowText
    Copies the text of the specified window's title bar. 
    GetWindowTextLength
    Retrieves the length of the specified window's title bar text. 
    GetWindowThreadProcessId
    Retrieves the identifier of the thread that created the specified window. 
    IsChild
    Tests whether a window is a child window or descendant window of a specified parent window. 
    IsGUIThread
    Tests whether the calling thread is already a GUI thread and optionally converts the thread to a GUI thread.
    IsIconic
    Determines whether the specified window is minimized (iconic). 
    IsWindow
    Determines whether the specified window handle identifies an existing window. 
    IsWindowUnicode
    Determines whether the specified window is a Unicode window. 
    IsWindowVisible
    Retrieves the visibility state of the specified window. 
    IsZoomed
    Determines whether a window is maximized (zoomed). 
    LockSetForegroundWindow
    Disables calls to SetForegroundWindow. 
    MoveWindow
    Changes the position and dimensions of the specified window. 
    OpenIcon
    Restores a minimized (iconic) window to its previous size and position. 
    RealChildWindowFromPoint
    Retrieves a handle to the child window at the specified point.
    RealGetWindowClass
    Retrieves the window type.
    SetForegroundWindow
    Puts the thread that created the specified window into the foreground and activates the window.
    SetLayeredWindowAttributes
    Sets the opacity and transparency color key of a layered window.
    SetLayout
    Changes the layout of a device context.
    SetParent
    Changes the parent window of the specified child window.
    SetProcessDefaultLayout
    Sets the default layout used for windows with no parent or owner.
    SetWindowPlacement
    Sets the show state and the restored, minimized, and maximized positions of the specified window.
    SetWindowPos
    Changes the size, position, and Z order of a window. 
    SetWindowText
    Changes the text of the specified window's title bar. 
    ShowOwnedPopups
    Shows or hides all pop-up windows owned by the specified window. 
    ShowWindow
    Sets the specified window's show state. 
    ShowWindowAsync
    Sets the show state of a window created by a different thread.
    TileWindows
    Tiles the specified child windows of the specified parent window.
    UpdateLayeredWindow
    Updates the position, size, shape, content, and translucency of a layered window. 
    WindowFromPoint
    Retrieves a handle to the window that contains the specified point. 
    WinMain
    An entry-point function called by the system as the initial entry point for a Windows-based application. 
      

  6.   

    首先递归findwindow直到找到你要操作的图片所在控件的handle,然后,嘿嘿,为所欲为吧。
      

  7.   

    对了,顺便问一下,当我知道了一个窗体中的tedit的句柄后,用什么函数可以给它的text赋值呢?
      

  8.   

    难啊。图片如果是用image加载的,不好找。它没有句柄...
    ---------------------------------------------------------
    非常同意!