小编Mis*_*r S的帖子

获取所有打开的WPF窗口

我正试图让所有打开的窗户.我尝试使用System.Windows.Application.Current.Windows但是我得到了Null Pointer Exception,其中foreach循环是.有谁知道出了什么问题?

public Window getWindow(String Title)
{
    Window windowObject = null;
    Console.WriteLine("Inside getWindow");
    foreach (Window window in System.Windows.Application.Current.Windows)
    {
        if (window.Title == Title)
        {
            windowObject = window;
        }
    }
    return windowObject;
}
Run Code Online (Sandbox Code Playgroud)

c# windows wpf

7
推荐指数
2
解决办法
2万
查看次数

在Java中使用RegSvr32注册DLL - 如何隐藏警报

我对RegSvr32的dll注册有问题.在应用程序启动之前,一切都是在Java下以编程方式完成 我的问题是:

是否有任何解决方案禁用警报出现DLL注册的结果?这是一个"OK"按钮的提示.

谢谢你的建议.

java dll regsvr32

3
推荐指数
1
解决办法
1768
查看次数

线程监听器通知

我遇到了处理线程完成的类的问题.它可以通知其他线程,因为第二个线程可以启动.这是我的项目结构:

MainClass.java

public class MainClass implements ThreadCompleteListener {

public void main(String[] args) throws InterruptedException {

    NotifyingThread test = new Thread1();
    test.addListener((ThreadCompleteListener) this); 
    test.start();         

}

@Override
public void notifyOfThreadComplete(Thread thread) {
    // TODO Auto-generated method stub

}   

}
Run Code Online (Sandbox Code Playgroud)

类 - Thread1.java

public class Thread1 extends NotifyingThread {

@Override
public void doRun() {
    try {
        metoda();
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

public static synchronized void metoda() throws InterruptedException {
    for(int i = 0; i …
Run Code Online (Sandbox Code Playgroud)

java multithreading handle

2
推荐指数
1
解决办法
5265
查看次数

标签 统计

java ×2

c# ×1

dll ×1

handle ×1

multithreading ×1

regsvr32 ×1

windows ×1

wpf ×1